|
| | __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()
Constructor.
- Paramètres
-
| 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.
- Paramètres
-
| string | $pattern | Pattern to match against |
| bool | $sort | |
- Renvoie
- array Files matching pattern @access private
◆ _tree()
Private method to list directories and files in each directory
- Paramètres
-
◆ addPathElement()
| addPathElement |
( |
|
$path, |
|
|
|
$element |
|
) |
| |
|
static |
Returns $path with $element added, with correct slash in-between.
- Paramètres
-
| string | $path | Path |
| string | $element | Element to and at end of path |
- Renvoie
- string Combined path @access public
◆ cd()
Change directory to $desired_path.
- Paramètres
-
| string | $path | Path to the directory to change to |
- Renvoie
- string 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.
- Paramètres
-
| string | $path | The path to chmod |
| bool | int | $mode | octal value 0755 |
| boolean | $recursive | chmod recursively |
| array | $exceptions | array of files, directories to skip |
- Renvoie
- boolean Returns TRUE on success, FALSE on failure @access public
◆ copy()
| copy |
( |
|
$options = array() | ) |
|
Recursive directory copy.
- Paramètres
-
| array | string | $options | (to, from, chmod, skip) |
- Renvoie
- bool @access public
◆ correctSlashFor()
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
- Paramètres
-
- Renvoie
- string Set of slashes ("\\" or "/") @access public
◆ create()
| create |
( |
|
$pathname, |
|
|
|
$mode = false |
|
) |
| |
Create a directory structure recursively.
- Paramètres
-
| string | $pathname | The directory structure to create |
| bool | int | $mode | octal value 0755 |
- Renvoie
- boolean Returns TRUE on success, FALSE on failure @access public
◆ delete()
Recursively Remove directories if system allow.
- Paramètres
-
| string | $path | Path of directory to delete |
- Renvoie
- boolean Success @access public
◆ dirsize()
Returns the size in bytes of this Folder.
- Renvoie
- int $size @access public
◆ errors()
get error from latest method
- Renvoie
- array @access public
◆ find()
| find |
( |
|
$regexp_pattern = '.*', |
|
|
|
$sort = false |
|
) |
| |
Returns an array of all matching files in current directory.
- Paramètres
-
| string | $regexp_pattern | Preg_match pattern (Defaults to: .*) |
| bool | $sort | |
- Renvoie
- 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.
- Paramètres
-
| string | $pattern | Preg_match pattern (Defaults to: .*) |
| bool | $sort | |
- Renvoie
- array Files matching $pattern @access public
◆ inPath()
| inPath |
( |
|
$path = '', |
|
|
|
$reverse = false |
|
) |
| |
Returns true if the File is in given path.
- Paramètres
-
- Renvoie
- bool @access public
◆ inXoopsPath()
| inXoopsPath |
( |
|
$path = '' | ) |
|
Returns true if the File is in a given XoopsPath.
- Paramètres
-
- Renvoie
- bool @access public
◆ isAbsolute()
Returns true if given $path is an absolute path.
- Paramètres
-
- Renvoie
- bool @access public
◆ isSlashTerm()
Returns true if given $path ends in a slash (i.e. is slash-terminated).
- Paramètres
-
- Renvoie
- boolean true if path ends with slash, false otherwise @access public
◆ isWindowsPath()
Returns true if given $path is a Windows path.
- Paramètres
-
- Renvoie
- boolean true if windows path, false otherwise @access public
◆ messages()
get messages from latest method
- Renvoie
- array @access public
◆ move()
Recursive directory move.
- Paramètres
-
| array | string | $options | (to, from, chmod, skip) |
- Renvoie
- boolean Success @access public
◆ normalizePath()
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
- Paramètres
-
- Renvoie
- string Set of slashes ("\\" or "/") @access public
◆ pwd()
Return current path.
- Renvoie
- string Current path @access public
◆ read()
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.
- Paramètres
-
| boolean | $sort | |
| mixed | $exceptions | either an array or boolean true will no grab dot files |
- Renvoie
- mixed Contents of current directory as an array, false on failure @access public
◆ realpath()
Get the real path (taking ".." and such into account)
- Paramètres
-
| string | $path | Path to resolve |
- Renvoie
- string The resolved path
◆ slashTerm()
Returns $path with added terminating slash (corrected for Windows or other OS).
- Paramètres
-
- Renvoie
- 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
- Paramètres
-
| 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 |
- Renvoie
- mixed array of nested directories and files in each directory @access public
◆ $directories
◆ $errors
◆ $files
◆ $messages
◆ $mode
◆ $path
◆ $sort
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/file/folder.php