\Horde_Pear_Package_Xml_Directory

Handles a directory in the contents list.

Summary

Methods
Properties
Constants
__construct()
getDirectory()
getFiles()
addFile()
deleteFile()
deleteSubdirectory()
getParent()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_getRoot()
_create()
_prependDirectory()
_addFile()
_deleteFile()
_prune()
_getDirectoryInsertionPoint()
_fileOrder()
_getFileInsertionPoint()
$_element
$_parent
$_subdirectories
$_files
N/A

Properties

$_subdirectories

$_subdirectories : array

The list of subdirectories.

Type

array

$_files

$_files : array

The list of files in this directory.

Type

array

Methods

__construct()

__construct(\Horde_Pear_Package_Xml_Element_Directory  $dir, mixed  $parent) 

Constructor.

Parameters

\Horde_Pear_Package_Xml_Element_Directory $dir

The directory element.

mixed $parent

The parent directory or the XML document.

getFiles()

getFiles() : array

Return the list of files in this hierarchy.

Returns

array —

The file list.

addFile()

addFile(string  $file, array  $params) 

Add a file to the list.

Parameters

string $file

The file name.

array $params

Additional file parameters.

deleteFile()

deleteFile(string  $file) 

Delete a file from the list.

Parameters

string $file

The file name.

deleteSubdirectory()

deleteSubdirectory(string  $dir) 

Delete a subdirectory from the list.

Parameters

string $dir

The directory name.

getParent()

getParent(array  $tree) : self

Ensure the provided path hierarchy.

Parameters

array $tree

The path elements that are required.

Returns

self —

The parent directory for the file.

_prependDirectory()

_prependDirectory(string  $path) : \The

Prepend the directory name of this directory to the path name.

Parameters

string $path

The input path name.

Returns

\The —

completed path.

_addFile()

_addFile(string  $file, array  $params) 

Add a file to the list.

Parameters

string $file

The file name.

array $params

Additional file parameters.

_deleteFile()

_deleteFile(string  $file) 

Delete a file from the list.

Parameters

string $file

The file name.

_prune()

_prune() 

Prune this directory if it is empty.

_getDirectoryInsertionPoint()

_getDirectoryInsertionPoint(string  $new) : mixed

Identify the insertion point for a new directory.

Parameters

string $new

The key for the new element.

Returns

mixed —

The insertion point.

_fileOrder()

_fileOrder(string  $a, string  $b) : integer

Sort order for files in the content list.

Parameters

string $a

First path.

string $b

Second path.

Returns

integer —

Sort comparison result.

_getFileInsertionPoint()

_getFileInsertionPoint(string  $new) : mixed

Identify the insertion point for a new file.

Parameters

string $new

The key for the new element.

Returns

mixed —

The insertion point.