class Filesystem
Provides basic utility to manipulate the file system.
Methods
copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false) Copies a file. | ||
mkdir(string|array|Traversable $dirs, int $mode = 511) Creates a directory recursively. | ||
bool | exists(string|array|Traversable $files) Checks the existence of files or directories. | |
touch(string|array|Traversable $files, int $time = null, int $atime = null) Sets access and modification time of file. | ||
remove(string|array|Traversable $files) Removes files or directories. | ||
chmod(string|array|Traversable $files, int $mode, int $umask, bool $recursive = false) Change mode for an array of files or directories. | ||
chown(string|array|Traversable $files, string $user, bool $recursive = false) Change the owner of an array of files or directories. | ||
chgrp(string|array|Traversable $files, string $group, bool $recursive = false) Change the group of an array of files or directories. | ||
rename(string $origin, string $target, bool $overwrite = false) Renames a file or a directory. | ||
symlink(string $originDir, string $targetDir, bool $copyOnWindows = false) Creates a symbolic link or copy a directory. | ||
string | makePathRelative(string $endPath, string $startPath) Given an existing path, convert it to a path relative to a given starting path. | |
mirror(string $originDir, string $targetDir, Traversable $iterator = null, array $options = array()) Mirrors a directory to another. | ||
bool | isAbsolutePath(string $file) Returns whether the file path is an absolute path. | |
string | tempnam(string $dir, string $prefix) Creates a temporary file with support for custom stream wrappers. | |
dumpFile(string $filename, string $content) Atomically dumps content into a file. |
Details
copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false)
Copies a file.
If the target file is older than the origin file, it's always overwritten. If the target file is newer, it is overwritten only when the $overwriteNewerFiles option is set to true.
mkdir(string|array|Traversable $dirs, int $mode = 511)
Creates a directory recursively.
bool exists(string|array|Traversable $files)
Checks the existence of files or directories.
touch(string|array|Traversable $files, int $time = null, int $atime = null)
Sets access and modification time of file.
remove(string|array|Traversable $files)
Removes files or directories.
chmod(string|array|Traversable $files, int $mode, int $umask, bool $recursive = false)
Change mode for an array of files or directories.
chown(string|array|Traversable $files, string $user, bool $recursive = false)
Change the owner of an array of files or directories.
chgrp(string|array|Traversable $files, string $group, bool $recursive = false)
Change the group of an array of files or directories.
rename(string $origin, string $target, bool $overwrite = false)
Renames a file or a directory.
symlink(string $originDir, string $targetDir, bool $copyOnWindows = false)
Creates a symbolic link or copy a directory.
string makePathRelative(string $endPath, string $startPath)
Given an existing path, convert it to a path relative to a given starting path.
mirror(string $originDir, string $targetDir, Traversable $iterator = null, array $options = array())
Mirrors a directory to another.
bool isAbsolutePath(string $file)
Returns whether the file path is an absolute path.
string tempnam(string $dir, string $prefix)
Creates a temporary file with support for custom stream wrappers.
dumpFile(string $filename, string $content)
Atomically dumps content into a file.
Please login to continue.