class FolderWrapper

Wrapper class for Folder

Methods

boolean
copy( string $src, string $dest, string $path = '', boolean $force = false, boolean $use_streams = false)

Helper wrapper method for copy

boolean
create( string $path = '', integer $mode = 493)

Helper wrapper method for create

boolean
delete( string $path)

Helper wrapper method for delete

mixed
move( string $src, string $dest, string $path = '', boolean $use_streams = false)

Helper wrapper method for move

boolean
exists( string $path)

Helper wrapper method for exists

array
files( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\\..*', '.*~'), boolean $naturalSort = false)

Helper wrapper method for files

array
folders( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\\..*'))

Helper wrapper method for folders

array
listFolderTree( string $path, string $filter, integer $maxLevel = 3, integer $level, integer $parent)

Helper wrapper method for listFolderTree

string
makeSafe( string $path)

Helper wrapper method for makeSafe

Details

boolean copy( string $src, string $dest, string $path = '', boolean $force = false, boolean $use_streams = false)

Helper wrapper method for copy

Parameters

string $src The path to the source folder.
string $dest The path to the destination folder.
string $path An optional base path to prefix to the file names.
boolean $force Force copy.
boolean $use_streams Optionally force folder/file overwrites.

Return Value

boolean True on success.

Exceptions

RuntimeException

See also

Folder::copy()

boolean create( string $path = '', integer $mode = 493)

Helper wrapper method for create

Parameters

string $path A path to create from the base path.
integer $mode Directory permissions to set for folders created. 0755 by default.

Return Value

boolean True if successful.

See also

Folder::create()

boolean delete( string $path)

Helper wrapper method for delete

Parameters

string $path The path to the folder to delete.

Return Value

boolean True on success.

Exceptions

UnexpectedValueException

See also

Folder::delete()

mixed move( string $src, string $dest, string $path = '', boolean $use_streams = false)

Helper wrapper method for move

Parameters

string $src The path to the source folder.
string $dest The path to the destination folder.
string $path An optional base path to prefix to the file names.
boolean $use_streams Optionally use streams.

Return Value

mixed Error message on false or boolean true on success.

See also

Folder::move()

boolean exists( string $path)

Helper wrapper method for exists

Parameters

string $path Folder name relative to installation dir.

Return Value

boolean True if path is a folder.

See also

Folder::exists()

array files( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\\..*', '.*~'), boolean $naturalSort = false)

Helper wrapper method for files

Parameters

string $path The path of the folder to read.
string $filter A filter for file names.
mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth.
boolean $full True to return the full path to the file.
array $exclude Array with names of files which should not be shown in the result.
array $excludefilter Array of filter to exclude.
boolean $naturalSort False for asort, true for natsort.

Return Value

array Files in the given folder.

See also

Folder::files()

array folders( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\\..*'))

Helper wrapper method for folders

Parameters

string $path The path of the folder to read.
string $filter A filter for folder names.
mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth.
boolean $full True to return the full path to the folders.
array $exclude Array with names of folders which should not be shown in the result.
array $excludefilter Array with regular expressions matching folders which should not be shown in the result.

Return Value

array Folders in the given folder.

See also

Folder::folders()

array listFolderTree( string $path, string $filter, integer $maxLevel = 3, integer $level, integer $parent)

Helper wrapper method for listFolderTree

Parameters

string $path The path of the folder to read.
string $filter A filter for folder names.
integer $maxLevel The maximum number of levels to recursively read, defaults to three.
integer $level The current level, optional.
integer $parent Unique identifier of the parent folder, if any.

Return Value

array Folders in the given folder.

See also

Folder::listFolderTree()

string makeSafe( string $path)

Helper wrapper method for makeSafe

Parameters

string $path The full path to sanitise.

Return Value

string The sanitised string

See also

Folder::makeSafe()