Folder structure browser, lists folders and files.
Long description for class
Methods | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct(bool|string $path = false, boolean $create = true, mixed $mode = false)
Constructor.
Constructor. Parameters
|
# | ||||||||
public
|
pwd(): string
Return current path.
Return current path. ReturnsCurrent path |
# | ||||||||
public
|
cd(string $path): string|false
Change directory to $desired_path.
Change directory to $desired_path. Parameters
ReturnsThe new path. Returns false on failure |
# | ||||||||
public
|
read(boolean $sort = true, mixed $exceptions = false): mixed
Returns an array of the contents of the current directory, or false on failure.
The returned array holds two arrays:…
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
ReturnsContents of current directory as an array, false on failure |
# | ||||||||
public
|
find(string $regexp_pattern = '.*', bool $sort = false): array
Returns an array of all matching files in current directory.
Returns an array of all matching files in current directory. Parameters
ReturnsFiles that match given pattern |
# | ||||||||
public
|
findRecursive(string $pattern = '.*', bool $sort = false): array
Returns an array of all matching files in and below current directory.
Returns an array of all matching files in and below current directory. Parameters
ReturnsFiles matching $pattern |
# | ||||||||
public
|
_findRecursive(string $pattern, bool $sort = false): array
Private helper function for findRecursive.
Private helper function for findRecursive. Parameters
ReturnsFiles matching pattern |
# | ||||||||
public
|
isWindowsPath(string $path): boolean
Returns true if given $path is a Windows path.
Returns true if given $path is a Windows path. Parameters
Returnstrue if windows path, false otherwise |
# | ||||||||
public
|
isAbsolute(string $path): bool
Returns true if given $path is an absolute path.
Returns true if given $path is an absolute path. Parameters
|
# | ||||||||
public
|
normalizePath(string $path): string
Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.) Parameters
ReturnsSet of slashes ("\" or "/") |
# | ||||||||
public
|
correctSlashFor(string $path): string
Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.) Parameters
ReturnsSet of slashes ("\" or "/") |
# | ||||||||
public
|
slashTerm(string $path): string
Returns $path with added terminating slash (corrected for Windows or other OS).
Returns $path with added terminating slash (corrected for Windows or other OS). Parameters
ReturnsPath with ending slash |
# | ||||||||
public
|
addPathElement(string $path, string $element): string
Returns $path with $element added, with correct slash in-between.
Returns $path with $element added, with correct slash in-between. Parameters
ReturnsCombined path |
# | ||||||||
public
|
inXoopsPath(string $path = ''): bool
Returns true if the File is in a given XoopsPath.
Returns true if the File is in a given XoopsPath. |
# | ||||||||
public
|
inPath(string $path = '', bool $reverse = false): bool
Returns true if the File is in given path.
Returns true if the File is in given path. |
# | ||||||||
public
|
chmod(string $path, bool|int $mode = false, boolean $recursive = true, array $exceptions = []): boolean
Change the mode on a directory structure recursively.
Change the mode on a directory structure recursively. Parameters
ReturnsReturns TRUE on success, FALSE on failure |
# | ||||||||
public
|
tree(string $path, boolean $hidden = true, string $type = null): mixed
Returns an array of nested directories and files in each directory
Returns an array of nested directories and files in each directory Parameters
Returnsarray of nested directories and files in each directory |
# | ||||||||
public
|
create(string $pathname, bool|int $mode = false): boolean
Create a directory structure recursively.
Create a directory structure recursively. Parameters
ReturnsReturns TRUE on success, FALSE on failure |
# | ||||||||
public
|
dirsize(): int
Returns the size in bytes of this Folder.
Returns the size in bytes of this Folder. Returns$size |
# | ||||||||
public
|
delete(string $path): boolean
Recursively Remove directories if system allow.
Recursively Remove directories if system allow. Parameters
ReturnsSuccess |
# | ||||||||
public
|
copy(array|string $options = []): bool
Copies files and directories from one directory to another
Copies files and directories from one directory to another Parameters
ReturnsReturns true on success, false on failure |
# | ||||||||
public
|
move(array|string $options): string|boolean
Recursive directory move.
Recursive directory move. Parameters
ReturnsSuccess |
# | ||||||||
public
|
messages(): array
get messages from latest method
get messages from latest method |
# | ||||||||
public
|
errors(): array
get error from latest method
get error from latest method |
# | ||||||||
public
|
realpath(string $path): string|false
Get the real path (taking ".." and such into account)
Get the real path (taking ".." and such into account) Parameters
ReturnsThe resolved path |
# | ||||||||
public
|
isSlashTerm(string $path): boolean
Returns true if given $path ends in a slash (i.e. is slash-terminated).
Returns true if given $path ends in a slash (i.e. is slash-terminated). Parameters
Returnstrue if path ends with slash, false otherwise |
# |
Properties | |||
---|---|---|---|
public
|
string
|
$path
|
# |
public
|
boolean
|
$sort = false
|
# |
public
|
boolean
|
$mode = '0755'
|
# |
public
|
array
|
$messages = []
|
# |
public
|
array
|
$errors = []
|
# |
public
|
array
|
$directories
|
# |
public
|
array
|
$files
|
# |