XOOPS 2.5.6
Final
|
Public Member Functions | |
__construct ($path=false, $create=true, $mode=false) | |
_findRecursive ($pattern, $sort=false) | |
_tree ($path, $hidden) | |
cd ($path) | |
chmod ($path, $mode=false, $recursive=true, $exceptions=array()) | |
copy ($options=array()) | |
create ($pathname, $mode=false) | |
delete ($path) | |
dirsize () | |
errors () | |
find ($regexp_pattern= '.*', $sort=false) | |
findRecursive ($pattern= '.*', $sort=false) | |
inPath ($path= '', $reverse=false) | |
inXoopsPath ($path= '') | |
messages () | |
move ($options) | |
pwd () | |
read ($sort=true, $exceptions=false) | |
realpath ($path) | |
tree ($path, $hidden=true, $type=null) | |
XoopsFolderHandler ($path, $create=false, $mode=false) | |
Static Public Member Functions | |
addPathElement ($path, $element) | |
correctSlashFor ($path) | |
isAbsolute ($path) | |
isSlashTerm ($path) | |
isWindowsPath ($path) | |
normalizePath ($path) | |
slashTerm ($path) | |
Public Attributes | |
$directories | |
$errors = false | |
$files | |
$messages = array() | |
$mode = '0755' | |
$path = null | |
$sort = false | |
Definition at line 54 of file folder.php.
Constructor.
string | $path | Path to folder |
boolean | $create | Create folder if not found |
mixed | $mode | Mode (CHMOD) to apply to created folder, false to ignore |
Definition at line 119 of file folder.php.
References $mode, $path, cd(), create(), isAbsolute(), and realpath().
Referenced by XoopsFolderHandler().
XoopsFolderHandler::_findRecursive | ( | $pattern, | |
$sort = false |
|||
) |
Private helper function for findRecursive.
string | $pattern | Pattern to match against |
Definition at line 255 of file folder.php.
References $dir, $file, $files, $path, $sort, $start, addPathElement(), cd(), findRecursive(), and read().
Referenced by findRecursive().
XoopsFolderHandler::_tree | ( | $path, | |
$hidden | |||
) |
Private method to list directories and files in each directory
string | $path | |
$ | = boolean $hidden private |
Definition at line 485 of file folder.php.
References $path.
Referenced by tree().
|
static |
Returns $path with $element added, with correct slash in-between.
string | $path | Path |
string | $element | Element to and at end of path |
Definition at line 359 of file folder.php.
References $path, and slashTerm().
Referenced by _findRecursive(), copy(), read(), and realpath().
XoopsFolderHandler::cd | ( | $path | ) |
Change directory to $desired_path.
string | $desired_path | Path to the directory to change to |
Definition at line 159 of file folder.php.
References $path, and realpath().
Referenced by __construct(), _findRecursive(), copy(), findRecursive(), and move().
Change the mode on a directory structure recursively.
string | $path | The path to chmod |
integer | $mode | octal value 0755 |
boolean | $recursive | chmod recursively |
array | $exceptions | array of files, directories to skip |
Definition at line 409 of file folder.php.
References $mode, $path, errors(), messages(), and tree().
Referenced by copy().
XoopsFolderHandler::copy | ( | $options = array() | ) |
Recursive directory copy.
array | $options | (to, from, chmod, skip) |
Definition at line 628 of file folder.php.
References $handle, $mode, $options, addPathElement(), cd(), chmod(), errors(), and messages().
Referenced by move().
|
static |
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
string | $path | Path to check |
Definition at line 326 of file folder.php.
References $path, and isWindowsPath().
Referenced by slashTerm().
XoopsFolderHandler::create | ( | $pathname, | |
$mode = false |
|||
) |
Create a directory structure recursively.
string | $pathname | The directory structure to create |
integer | $mode | octal value 0755 |
Definition at line 514 of file folder.php.
References $mode, errors(), and messages().
Referenced by __construct().
XoopsFolderHandler::delete | ( | $path | ) |
Recursively Remove directories if system allow.
string | $path | Path of directory to delete |
Definition at line 584 of file folder.php.
References $file, $files, $path, errors(), messages(), and slashTerm().
XoopsFolderHandler::dirsize | ( | ) |
Returns the size in bytes of this Folder.
string | $directory | Path to directory public |
Definition at line 547 of file folder.php.
References $dir, $i, $j, and slashTerm().
XoopsFolderHandler::errors | ( | ) |
XoopsFolderHandler::find | ( | $regexp_pattern = '.*' , |
|
$sort = false |
|||
) |
Returns an array of all matching files in current directory.
string | $pattern | Preg_match pattern (Defaults to: .*) |
Definition at line 217 of file folder.php.
References $file, $files, $sort, and read().
XoopsFolderHandler::findRecursive | ( | $pattern = '.*' , |
|
$sort = false |
|||
) |
Returns an array of all matching files in and below current directory.
string | $pattern | Preg_match pattern (Defaults to: .*) |
Definition at line 240 of file folder.php.
References $path, $sort, _findRecursive(), and cd().
Referenced by _findRecursive().
XoopsFolderHandler::inPath | ( | $path = '' , |
|
$reverse = false |
|||
) |
Returns true if the File is in given path.
Definition at line 383 of file folder.php.
References $dir, $path, pwd(), and slashTerm().
Referenced by inXoopsPath().
XoopsFolderHandler::inXoopsPath | ( | $path = '' | ) |
Returns true if the File is in a given XoopsPath.
Definition at line 370 of file folder.php.
References $dir, $path, inPath(), and slashTerm().
|
static |
Returns true if given $path is an absolute path.
string | $path | Path to check |
Definition at line 296 of file folder.php.
References $path.
Referenced by __construct(), and realpath().
|
static |
Returns true if given $path ends in a slash (i.e. is slash-terminated).
string | $path | Path to check |
Definition at line 794 of file folder.php.
References $path.
Referenced by slashTerm().
|
static |
Returns true if given $path is a Windows path.
string | $path | Path to check |
Definition at line 280 of file folder.php.
References $path.
Referenced by correctSlashFor(), and normalizePath().
XoopsFolderHandler::messages | ( | ) |
XoopsFolderHandler::move | ( | $options | ) |
Recursive directory move.
array | $options | (to, from, chmod, skip) |
Definition at line 705 of file folder.php.
References $options, cd(), and copy().
|
static |
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
string | $path | Path to check |
Definition at line 310 of file folder.php.
References $path, and isWindowsPath().
XoopsFolderHandler::pwd | ( | ) |
Return current path.
Definition at line 147 of file folder.php.
References $path.
Referenced by inPath().
Returns an array of the contents of the current directory, or false on failure. The returned array holds two arrays: one of dirs and one of files.
boolean | $sort | |
mixed | $exceptions | either an array or boolean true will no grab dot files |
Definition at line 177 of file folder.php.
References $dir, $files, $sort, and addPathElement().
Referenced by _findRecursive(), and find().
XoopsFolderHandler::realpath | ( | $path | ) |
Get the real path (taking ".." and such into account)
string | $path | Path to resolve |
Definition at line 753 of file folder.php.
References $path, addPathElement(), and isAbsolute().
Referenced by __construct(), and cd().
|
static |
Returns $path with added terminating slash (corrected for Windows or other OS).
string | $path | Path to check |
Definition at line 342 of file folder.php.
References $path, correctSlashFor(), and isSlashTerm().
Referenced by addPathElement(), delete(), dirsize(), inPath(), and inXoopsPath().
XoopsFolderHandler::tree | ( | $path, | |
$hidden = true , |
|||
$type = null |
|||
) |
Returns an array of nested directories and files in each directory
string | $path | the directory path to build the tree from |
boolean | $hidden | return hidden files and directories |
string | $type | either file or dir. null returns both files and directories |
Definition at line 455 of file folder.php.
References $dir, $directories, $files, $path, $type, and _tree().
Referenced by chmod().
Definition at line 136 of file folder.php.
References $mode, $path, and __construct().
XoopsFolderHandler::$directories |
Definition at line 102 of file folder.php.
Referenced by tree().
XoopsFolderHandler::$errors = false |
Definition at line 94 of file folder.php.
Referenced by errors().
XoopsFolderHandler::$files |
Definition at line 110 of file folder.php.
Referenced by _findRecursive(), delete(), find(), read(), and tree().
XoopsFolderHandler::$messages = array() |
Definition at line 86 of file folder.php.
Referenced by messages().
XoopsFolderHandler::$mode = '0755' |
Definition at line 78 of file folder.php.
Referenced by __construct(), chmod(), copy(), create(), and XoopsFolderHandler().
XoopsFolderHandler::$path = null |
Definition at line 62 of file folder.php.
Referenced by __construct(), _findRecursive(), _tree(), addPathElement(), cd(), chmod(), correctSlashFor(), delete(), findRecursive(), inPath(), inXoopsPath(), isAbsolute(), isSlashTerm(), isWindowsPath(), normalizePath(), pwd(), realpath(), slashTerm(), tree(), and XoopsFolderHandler().
XoopsFolderHandler::$sort = false |
Definition at line 70 of file folder.php.
Referenced by _findRecursive(), find(), findRecursive(), and read().