Filesystem::isAbsolutePath()

bool isAbsolutePath(string $file) Returns whether the file path is an absolute path. Parameters string $file A file path Return Value bool

Filesystem::rename()

rename(string $origin, string $target, bool $overwrite = false) Renames a file or a directory. Parameters string $origin The origin filename or directory string $target The new filename or directory bool $overwrite Whether to overwrite the target if it already exists Exceptions IOException When target file or directory already exists IOException When origin cannot be renamed

Filesystem::makePathRelative()

string makePathRelative(string $endPath, string $startPath) Given an existing path, convert it to a path relative to a given starting path. Parameters string $endPath Absolute path of target string $startPath Absolute path where traversal begins Return Value string Path of target relative to starting path

Filesystem::remove()

remove(string|array|Traversable $files) Removes files or directories. Parameters string|array|Traversable $files A filename, an array of files, or a \Traversable instance to remove Exceptions IOException When removal fails

Filesystem::mirror()

mirror(string $originDir, string $targetDir, Traversable $iterator = null, array $options = array()) Mirrors a directory to another. Parameters string $originDir The origin directory string $targetDir The target directory Traversable $iterator A Traversable instance array $options An array of boolean options Valid options are: - $options['override'] Whether to override an existing file on copy or not (see copy()) - $options['copyonwindows'] Whether to copy files instead of links on

Filesystem::chown()

chown(string|array|Traversable $files, string $user, bool $recursive = false) Change the owner of an array of files or directories. Parameters string|array|Traversable $files A filename, an array of files, or a \Traversable instance to change owner string $user The new owner user name bool $recursive Whether change the owner recursively or not Exceptions IOException When the change fail

Filesystem::chgrp()

chgrp(string|array|Traversable $files, string $group, bool $recursive = false) Change the group of an array of files or directories. Parameters string|array|Traversable $files A filename, an array of files, or a \Traversable instance to change group string $group The group name bool $recursive Whether change the group recursively or not Exceptions IOException When the change fail

Filesystem::copy()

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. Parameters string $originFile The original filename string $targetFile The target filename bool $overwriteNewerFiles If true, target files newer than origin files are overwritten Exceptions FileNotFoundException

Filesystem::chmod()

chmod(string|array|Traversable $files, int $mode, int $umask, bool $recursive = false) Change mode for an array of files or directories. Parameters string|array|Traversable $files A filename, an array of files, or a \Traversable instance to change mode int $mode The new mode (octal) int $umask The mode mask (octal) bool $recursive Whether change the mod recursively or not Exceptions IOException When the change fail

Filesystem::exists()

bool exists(string|array|Traversable $files) Checks the existence of files or directories. Parameters string|array|Traversable $files A filename, an array of files, or a \Traversable instance to check Return Value bool true if the file exists, false otherwise