This provides convenience wrappers around common filesystem queries.
This is an internal helper class that should not be used in application code as it provides no guarantee for compatibility.
string
'dir'
copyDir(string $source, string $destination)
Copies directory with all it's contents.
string
$source Source path.
string
$destination Destination path.
bool
deleteDir(string $path)
Delete directory along with all it's contents.
string
$path Directory path.
bool
Cake\Core\Exception\Exception
dumpFile(string $filename, string $content)
Dump contents to file.
string
$filename File path.
string
$content Content to dump.
Cake\Core\Exception\Exception
filterIterator(\Iterator $iterator, mixed $filter)
Wrap iterator in additional filtering iterator.
\Iterator
$iterator Iterator
mixed
$filter Regex string or callback.
\Iterator
find(string $path, mixed $filter, ?int $flags)
Find files / directories (non-recursively) in given directory path.
string
$path Directory path.
mixed
$filter optional If string will be used as regex for filtering using RegexIterator
, if callable will be as callback for CallbackFilterIterator
.
int|null
$flags optional Flags for FilesystemIterator::__construct();
\Iterator
findRecursive(string $path, mixed $filter, ?int $flags)
Find files/ directories recursively in given directory path.
string
$path Directory path.
mixed
$filter optional If string will be used as regex for filtering using RegexIterator
, if callable will be as callback for CallbackFilterIterator
. Hidden directories (starting with dot e.g. .git) are always skipped.
int|null
$flags optional Flags for FilesystemIterator::__construct();
\Iterator
isStream(string $path)
Check whether the given path is a stream path.
string
$path Path.
bool
mkdir(string $dir, int $mode)
Create directory.
string
$dir Directory path.
int
$mode optional Octal mode passed to mkdir(). Defaults to 0755.
Cake\Core\Exception\Exception
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Filesystem.Filesystem.html