class Filesystem
Provides basic utility to manipulate the file system.
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. |
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.
Creates a directory recursively.
Checks the existence of files or directories.
Sets access and modification time of file.
Removes files or directories.
Change mode for an array of files or directories.
Change the owner of an array of files or directories.
Change the group of an array of files or directories.
Renames a file or a directory.
Creates a symbolic link or copy a directory.
Given an existing path, convert it to a path relative to a given starting path.
Mirrors a directory to another.
Returns whether the file path is an absolute path.
Creates a temporary file with support for custom stream wrappers.
Atomically dumps content into a file.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.1/Symfony/Component/Filesystem/Filesystem.html