|
| __construct ($path=false, $create=true, $mode=false) |
|
| pwd () |
|
| cd ($path) |
|
| read ($sort=true, $exceptions=false) |
|
| find ($regexp_pattern='.*', $sort=false) |
|
| findRecursive ($pattern='.*', $sort=false) |
|
| _findRecursive ($pattern, $sort=false) |
|
| inXoopsPath ($path='') |
|
| inPath ($path='', $reverse=false) |
|
| chmod ($path, $mode=false, $recursive=true, $exceptions=array()) |
|
| tree ($path, $hidden=true, $type=null) |
|
| _tree ($path, $hidden) |
|
| create ($pathname, $mode=false) |
|
| dirsize () |
|
| delete ($path) |
|
| copy ($options=array()) |
|
| move ($options) |
|
| messages () |
|
| errors () |
|
| realpath ($path) |
|
◆ __construct()
__construct |
( |
|
$path = false , |
|
|
|
$create = true , |
|
|
|
$mode = false |
|
) |
| |
Constructor.
- Parameters
-
bool | string | $path | Path to folder |
boolean | $create | Create folder if not found |
mixed | $mode | Mode (CHMOD) to apply to created folder, false to ignore |
◆ _findRecursive()
_findRecursive |
( |
|
$pattern, |
|
|
|
$sort = false |
|
) |
| |
Private helper function for findRecursive.
- Parameters
-
string | $pattern | Pattern to match against |
bool | $sort | |
- Returns
- array Files matching pattern @access private
◆ _tree()
Private method to list directories and files in each directory
- Parameters
-
◆ addPathElement()
addPathElement |
( |
|
$path, |
|
|
|
$element |
|
) |
| |
|
static |
Returns $path with $element added, with correct slash in-between.
- Parameters
-
string | $path | Path |
string | $element | Element to and at end of path |
- Returns
- string Combined path @access public
◆ cd()
Change directory to $desired_path.
- Parameters
-
string | $path | Path to the directory to change to |
- Returns
- string|false The new path. Returns false on failure @access public
◆ chmod()
chmod |
( |
|
$path, |
|
|
|
$mode = false , |
|
|
|
$recursive = true , |
|
|
|
$exceptions = array() |
|
) |
| |
Change the mode on a directory structure recursively.
- Parameters
-
string | $path | The path to chmod |
bool | int | $mode | octal value 0755 |
boolean | $recursive | chmod recursively |
array | $exceptions | array of files, directories to skip |
- Returns
- boolean Returns TRUE on success, FALSE on failure @access public
◆ copy()
copy |
( |
|
$options = array() | ) |
|
Recursive directory copy.
- Parameters
-
array | string | $options | (to, from, chmod, skip) |
- Returns
- bool @access public
◆ correctSlashFor()
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
- Parameters
-
- Returns
- string Set of slashes ("\\" or "/") @access public
◆ create()
create |
( |
|
$pathname, |
|
|
|
$mode = false |
|
) |
| |
Create a directory structure recursively.
- Parameters
-
string | $pathname | The directory structure to create |
bool | int | $mode | octal value 0755 |
- Returns
- boolean Returns TRUE on success, FALSE on failure @access public
◆ delete()
Recursively Remove directories if system allow.
- Parameters
-
string | $path | Path of directory to delete |
- Returns
- boolean Success @access public
◆ dirsize()
Returns the size in bytes of this Folder.
- Returns
- int $size @access public
◆ errors()
get error from latest method
- Returns
- array @access public
◆ find()
find |
( |
|
$regexp_pattern = '.*' , |
|
|
|
$sort = false |
|
) |
| |
Returns an array of all matching files in current directory.
- Parameters
-
string | $regexp_pattern | Preg_match pattern (Defaults to: .*) |
bool | $sort | |
- Returns
- array Files that match given pattern @access public
◆ findRecursive()
findRecursive |
( |
|
$pattern = '.*' , |
|
|
|
$sort = false |
|
) |
| |
Returns an array of all matching files in and below current directory.
- Parameters
-
string | $pattern | Preg_match pattern (Defaults to: .*) |
bool | $sort | |
- Returns
- array Files matching $pattern @access public
◆ inPath()
inPath |
( |
|
$path = '' , |
|
|
|
$reverse = false |
|
) |
| |
Returns true if the File is in given path.
- Parameters
-
- Returns
- bool @access public
◆ inXoopsPath()
inXoopsPath |
( |
|
$path = '' | ) |
|
Returns true if the File is in a given XoopsPath.
- Parameters
-
- Returns
- bool @access public
◆ isAbsolute()
Returns true if given $path is an absolute path.
- Parameters
-
- Returns
- bool @access public
◆ isSlashTerm()
Returns true if given $path ends in a slash (i.e. is slash-terminated).
- Parameters
-
- Returns
- boolean true if path ends with slash, false otherwise @access public
◆ isWindowsPath()
Returns true if given $path is a Windows path.
- Parameters
-
- Returns
- boolean true if windows path, false otherwise @access public
◆ messages()
get messages from latest method
- Returns
- array @access public
◆ move()
Recursive directory move.
- Parameters
-
array | string | $options | (to, from, chmod, skip) |
- Returns
- string|boolean Success @access public
◆ normalizePath()
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
- Parameters
-
- Returns
- string Set of slashes ("\\" or "/") @access public
◆ pwd()
Return current path.
- Returns
- string Current path @access public
◆ read()
read |
( |
|
$sort = true , |
|
|
|
$exceptions = false |
|
) |
| |
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.
- Parameters
-
boolean | $sort | |
mixed | $exceptions | either an array or boolean true will no grab dot files |
- Returns
- mixed Contents of current directory as an array, false on failure @access public
◆ realpath()
Get the real path (taking ".." and such into account)
- Parameters
-
string | $path | Path to resolve |
- Returns
- string|false The resolved path
◆ slashTerm()
Returns $path with added terminating slash (corrected for Windows or other OS).
- Parameters
-
- Returns
- string Path with ending slash @access public
◆ tree()
tree |
( |
|
$path, |
|
|
|
$hidden = true , |
|
|
|
$type = null |
|
) |
| |
Returns an array of nested directories and files in each directory
- Parameters
-
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 |
- Returns
- mixed array of nested directories and files in each directory @access public
◆ $directories
◆ $errors
◆ $files
◆ $messages
◆ $mode
◆ $path
◆ $sort
The documentation for this class was generated from the following file: