Throws

When no directory was specified, when the directory does not exist or when the path specified is not a directory

->__get()internal public

Please note: this method is public, however it is
primarily intended for internal use by Flourish and will normally not
be useful in site/application code

All requests that hit this method should be requests for callbacks

Signature

callback__get(string$method)

Parameters

string

$method

The method to create a callback for

Returns

The callback for the method requested

->__toString()public

Returns the full filesystem path for the directory

Signature

string__toString()

Returns

The full filesystem path

->clear()public

Removes all files and directories inside of the directory

Signature

voidclear()

->delete()public

Will delete a directory and all files and directories inside of it

This operation will not be performed until the filesystem transaction has been committed, if a transaction is in progress. Any non-Flourish code (PHP or system) will still see this directory and all contents as existing until that point.

Returns

Throws

When the new parent directory passed is not a directory, is not readable or is a sub-directory of this directory

->rename()public

Renames the current directory

This operation will NOT be performed until the filesystem transaction has been committed, if a transaction is in progress. Any non-Flourish code (PHP or system) will still see this directory (and all contained files/dirs) as existing with the old paths until that point.

Signature

voidrename(string$new_dirname,boolean$overwrite)

Parameters

string

$new_dirname

The new full path to the directory or a new name in the current parent directory

boolean

$overwrite

If the new dirname already exists, TRUE will cause the file to be overwritten, FALSE will cause the new filename to change

->scan()public

If the $filter looks like a valid PCRE pattern - matching delimeters (a delimeter can be any non-alphanumeric, non-backslash, non-whitespace character) followed by zero or more of the flags i, m, s, x, e, A, D, S, U, X, J, u - then preg_match() will be used.

Otherwise the $filter will do a case-sensitive match with * matching zero or more characters and ? matching a single character.

On all OSes (even Windows), directories will be separated by /s when comparing with the $filter.

Signature

arrayscan(string$filter=NULL )

Parameters

string

$filter

A PCRE or glob pattern to filter files/directories by path - directories can be detected by checking for a trailing / (even on Windows)