Documentation

Horde_Pear_Package_Xml_Directory
in package

Handles a directory in the contents list.

Tags
author

Gunnar Wrobel wrobel@pardus.de

category

Horde

copyright

2011-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

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

$_files

The list of files in this directory.

private array<string|int, mixed> $_files

$_subdirectories

The list of subdirectories.

private array<string|int, mixed> $_subdirectories = array()

Methods

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

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

_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.

_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
Return values
mixed

Search results