class Filesystem
Provides basic utility to manipulate the file system.
Methods
|
copy(string $originFile, string $targetFile, array $override = false)
Copies a file. |
||
| Boolean |
mkdir(string|array|Traversable $dirs, int $mode = 511)
Creates a directory recursively. |
|
|
touch(string|array|Traversable $files)
Creates empty files. |
||
|
remove(string|array|Traversable $files)
Removes files or directories. |
||
|
chmod(string|array|Traversable $files, integer $mode, integer $umask)
Change mode for an array of files or directories. |
||
|
rename(string $origin, string $target)
Renames a file. |
||
|
symlink(string $originDir, string $targetDir, Boolean $copyOnWindows = false)
Creates a symbolic link or copy a directory. |
||
|
mirror(string $originDir, string $targetDir, Traversable $iterator = null, array $options = array())
Mirrors a directory to another. |
||
| Boolean |
isAbsolutePath(string $file)
Returns whether the file path is an absolute path. |
Details
at line 32
public
copy(string $originFile, string $targetFile, array $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 55
public Boolean
mkdir(string|array|Traversable $dirs, int $mode = 511)
Creates a directory recursively.
at line 74
public
touch(string|array|Traversable $files)
Creates empty files.
at line 86
public
remove(string|array|Traversable $files)
Removes files or directories.
at line 112
public
chmod(string|array|Traversable $files, integer $mode, integer $umask)
Change mode for an array of files or directories.
at line 132
public
rename(string $origin, string $target)
Renames a file.
at line 149
public
symlink(string $originDir, string $targetDir, Boolean $copyOnWindows = false)
Creates a symbolic link or copy a directory.
at line 184
public
mirror(string $originDir, string $targetDir, Traversable $iterator = null, array $options = array())
Mirrors a directory to another.
at line 226
public Boolean
isAbsolutePath(string $file)
Returns whether the file path is an absolute path.