Filesystem
class Filesystem
Provides basic utility to manipulate the file system.
Methods
Copies a file.
Sets access and modification time of file.
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.
Details
at line line 38
copy(string $originFile, string $targetFile, bool $override = false)
Copies a file.
This method only copies the file if the origin file is newer than the target file.
By default, if the target already exists, it is not overridden.
at line line 88
mkdir(string|array|Traversable $dirs, int $mode = 511)
Creates a directory recursively.
at line line 115
bool
exists(string|array|Traversable $files)
Checks the existence of files or directories.
at line line 135
touch(string|array|Traversable $files, int $time = null, int $atime = null)
Sets access and modification time of file.
at line line 152
remove(string|array|Traversable $files)
Removes files or directories.
at line line 192
chmod(string|array|Traversable $files, int $mode, int $umask, bool $recursive = false)
Change mode for an array of files or directories.
at line line 213
chown(string|array|Traversable $files, string $user, bool $recursive = false)
Change the owner of an array of files or directories.
at line line 240
chgrp(string|array|Traversable $files, string $group, bool $recursive = false)
Change the group of an array of files or directories.
at line line 268
rename(string $origin, string $target, bool $overwrite = false)
Renames a file or a directory.
at line line 289
symlink(string $originDir, string $targetDir, bool $copyOnWindows = false)
Creates a symbolic link or copy a directory.
at line line 327
string
makePathRelative(string $endPath, string $startPath)
Given an existing path, convert it to a path relative to a given starting path.
at line line 378
mirror(string $originDir, string $targetDir, Traversable $iterator = null, array $options = array())
Mirrors a directory to another.
at line line 444
bool
isAbsolutePath(string $file)
Returns whether the file path is an absolute path.
at line line 464
string
tempnam(string $dir, string $prefix)
Creates a temporary file with support for custom stream wrappers.
at line line 515
dumpFile(string $filename, string $content)
Atomically dumps content into a file.