Properties

$path

$path : string

The directory path

Type

string

$files

$files : array

The files within the directory

Type

array

$objects

$objects : array

The file info objects within the directory

Type

array

$tree

$tree : array

The nested tree map of the directory and its files

Type

array

$absolute

$absolute : boolean

Flag to store the absolute path.

Type

boolean

$relative

$relative : boolean

Flag to store the relative path.

Type

boolean

$recursive

$recursive : boolean

Flag to dig recursively.

Type

boolean

$filesOnly

$filesOnly : boolean

Flag to include only files and no directories

Type

boolean

Methods

__construct()

__construct(string  $dir, array  $options = array()) : \Pop\File\Dir

Constructor

Instantiate a directory object

Parameters

string $dir
array $options

Throws

\Pop\File\Exception

Returns

\Pop\File\Dir

setAbsolute()

setAbsolute(boolean  $absolute) : \Pop\File\Dir

Set absolute

Parameters

boolean $absolute

Returns

\Pop\File\Dir

setRelative()

setRelative(boolean  $relative) : \Pop\File\Dir

Set relative

Parameters

boolean $relative

Returns

\Pop\File\Dir

setRecursive()

setRecursive(boolean  $recursive) : \Pop\File\Dir

Set recursive

Parameters

boolean $recursive

Returns

\Pop\File\Dir

setFilesOnly()

setFilesOnly(boolean  $filesOnly) : \Pop\File\Dir

Set files only

Parameters

boolean $filesOnly

Returns

\Pop\File\Dir

isAbsolute()

isAbsolute() : boolean

Is absolute

Returns

boolean

isRelative()

isRelative() : boolean

Is relative

Returns

boolean

isRecursive()

isRecursive() : boolean

Is recursive

Returns

boolean

isFilesOnly()

isFilesOnly() : boolean

Is files only

Returns

boolean

getPath()

getPath() : string

Get the path

Returns

string

getFiles()

getFiles() : array

Get the files

Returns

array

getObjects()

getObjects() : array

Get the objects

Returns

array

getTree()

getTree() : array

Get the tree

Returns

array

copyDir()

copyDir(string  $dest, boolean  $full = true) : void

Copy an entire directory recursively

Parameters

string $dest
boolean $full

emptyDir()

emptyDir(boolean  $remove = false, string  $path = null) : void

Empty an entire directory

Parameters

boolean $remove
string $path

traverse()

traverse() : void

Traverse the directory

buildTree()

buildTree(\DirectoryIterator  $it) : array

Build the directory tree

Parameters

\DirectoryIterator $it

Returns

array