Horde_Pear_Package_Xml_Directory
in package
Handles a directory in the contents list.
Tags
Table of Contents
- $_element : Horde_Pear_Package_Xml_Element_Directory
- The directory node.
- $_files : array<string|int, mixed>
- The list of files in this directory.
- $_parent : Horde_Pear_Package_Xml_Directory
- The parent directory.
- $_subdirectories : array<string|int, mixed>
- The list of subdirectories.
- __construct() : mixed
- Constructor.
- addFile() : mixed
- Add a file to the list.
- deleteFile() : mixed
- Delete a file from the list.
- deleteSubdirectory() : mixed
- Delete a subdirectory from the list.
- getDirectory() : Horde_Pear_Package_Xml_Element_Directory
- Return the directory node.
- getFiles() : array<string|int, mixed>
- Return the list of files in this hierarchy.
- getParent() : self
- Ensure the provided path hierarchy.
- _addFile() : mixed
- Add a file to the list.
- _create() : Horde_Pear_Package_Xml_Directory
- Create a new directory handler.
- _deleteFile() : mixed
- Delete a file from the list.
- _fileOrder() : int
- Sort order for files in the content list.
- _getDirectoryInsertionPoint() : mixed
- Identify the insertion point for a new directory.
- _getFileInsertionPoint() : mixed
- Identify the insertion point for a new file.
- _getRoot() : Horde_Pear_Package_Xml_Directory
- Create a new directory handler.
- _prependDirectory() : The
- Prepend the directory name of this directory to the path name.
- _prune() : mixed
- Prune this directory if it is empty.
Properties
$_element
The directory node.
private
Horde_Pear_Package_Xml_Element_Directory
$_element
$_files
The list of files in this directory.
private
array<string|int, mixed>
$_files
$_parent
The parent directory.
private
Horde_Pear_Package_Xml_Directory
$_parent
$_subdirectories
The list of subdirectories.
private
array<string|int, mixed>
$_subdirectories
= array()
Methods
__construct()
Constructor.
public
__construct(Horde_Pear_Package_Xml_Element_Directory $dir, mixed $parent) : mixed
Parameters
- $dir : Horde_Pear_Package_Xml_Element_Directory
-
The directory element.
- $parent : mixed
-
The parent directory or the XML document.
Return values
mixed —addFile()
Add a file to the list.
public
addFile(string $file, array<string|int, mixed> $params) : mixed
Parameters
- $file : string
-
The file name.
- $params : array<string|int, mixed>
-
Additional file parameters.
Return values
mixed —deleteFile()
Delete a file from the list.
public
deleteFile(string $file) : mixed
Parameters
- $file : string
-
The file name.
Return values
mixed —deleteSubdirectory()
Delete a subdirectory from the list.
public
deleteSubdirectory(string $dir) : mixed
Parameters
- $dir : string
-
The directory name.
Return values
mixed —getDirectory()
Return the directory node.
public
getDirectory() : Horde_Pear_Package_Xml_Element_Directory
Return values
Horde_Pear_Package_Xml_Element_Directory —The directory node.
getFiles()
Return the list of files in this hierarchy.
public
getFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —The file list.
getParent()
Ensure the provided path hierarchy.
public
getParent(array<string|int, mixed> $tree) : self
Parameters
- $tree : array<string|int, mixed>
-
The path elements that are required.
Return values
self —The parent directory for the file.
_addFile()
Add a file to the list.
private
_addFile(string $file, array<string|int, mixed> $params) : mixed
Parameters
- $file : string
-
The file name.
- $params : array<string|int, mixed>
-
Additional file parameters.
Return values
mixed —_create()
Create a new directory handler.
private
_create(Horde_Pear_Package_Xml_Element_Directory $element, Horde_Pear_Package_Xml_Directory $parent) : Horde_Pear_Package_Xml_Directory
Parameters
- $element : Horde_Pear_Package_Xml_Element_Directory
-
The represented element.
- $parent : Horde_Pear_Package_Xml_Directory
-
The parent directory.
Return values
Horde_Pear_Package_Xml_Directory —_deleteFile()
Delete a file from the list.
private
_deleteFile(string $file) : mixed
Parameters
- $file : string
-
The file name.
Return values
mixed —_fileOrder()
Sort order for files in the content list.
private
_fileOrder(string $a, string $b) : int
Parameters
- $a : string
-
First path.
- $b : string
-
Second path.
Return values
int —Sort comparison result.
_getDirectoryInsertionPoint()
Identify the insertion point for a new directory.
private
_getDirectoryInsertionPoint(string $new) : mixed
Parameters
- $new : string
-
The key for the new element.
Return values
mixed —The insertion point.
_getFileInsertionPoint()
Identify the insertion point for a new file.
private
_getFileInsertionPoint(string $new) : mixed
Parameters
- $new : string
-
The key for the new element.
Return values
mixed —The insertion point.
_getRoot()
Create a new directory handler.
private
_getRoot() : Horde_Pear_Package_Xml_Directory
Return values
Horde_Pear_Package_Xml_Directory —_prependDirectory()
Prepend the directory name of this directory to the path name.
private
_prependDirectory(string $path) : The
Parameters
- $path : string
-
The input path name.
Return values
The —completed path.
_prune()
Prune this directory if it is empty.
private
_prune() : mixed