recursive_rmdir()
recursive_rmdir(string $directory)
Recursively remove a directory an alias for recursive_remove_directory
Parameters
string | $directory | The absolute path to the directory to be removed. |
A simple class for utilities related to manipulating directories.
and searching. and to include builtin caching
file_list_regexp(string $dir, string $regexp, int $limit)
A function to return a list of all files in a directory that match a regular expression.
This method is not recursive.
string | $dir | The absolute path to the directory to search |
string | $regexp | The regular expression |
int | $limit | The maximum number of results to return. |
mkdirr(string $pathname, int $mode, $callback) : bool
Recursively create a subdirectory till the path exists
string | $pathname | The path name to create |
int | $mode | The octal permission for the newly created subdirectories |
$callback |
todo |
---|
get_file_list(string $dir, string $extensions, bool $sorted) : string[]
Given a directlry, and a list of extensions, return a list of matching files.
This method will not return any directories. This method is not recursive.
string | $dir | The search directory |
string | $extensions | A comma delimited list of extensions to return |
bool | $sorted | Wether the output should be sorted (natural case) or not. |
todo |
---|
file_matches_pattern(string $filename, mixed $pattern, bool $case_sensitive, bool $allow_empty)
Given a filename, test if it matches the specified pattern
string | $filename | The test filename (string) or an array of strings |
mixed | $pattern | An array of string patterns, or a single string. |
bool | $case_sensitive | Wether the pattern(s) is/are case sensitive |
bool | $allow_empty | Wether or not an empty pattern is allowed (to match anything) (deprecated) |
todo |
---|
recursive_glob(string $path, mixed $pattern, string $mode, mixed $excludepattern, int $maxdepth, int $d)
Similar to the PHP glob method this function will search all files in the directory (and below it) and return all files that match the pattern.
string | $path | The full path to the input directory |
mixed | $pattern | An array of string patterns. Or a single string |
string | $mode | Either FILES, DIRS, or FULL. If 'FILES', only files matching the pattern are returned. If 'DIRS' only directories are returned. IF 'FULL', any file or directory matching the pattern is returned. |
mixed | $excludepattern | An array of string patterns to exclude. Or a simple string |
int | $maxdepth | The maximum dirctory level to search. Default is infinite. |
int | $d | Internal |
todo |
---|