Filesystem
Uses
Methods
exists ( $path ) : bool
Determine if a file or directory exists.
Parameters
- $path string
missing ( $path ) : bool
Determine if a file or directory is missing.
Parameters
- $path string
get ( $path , $lock ) : string
Get the contents of a file.
Parameters
- $path string
- $lock bool
sharedGet ( $path ) : string
Get contents of a file with shared access.
Parameters
- $path string
getRequire ( $path , array $data ) : mixed
Get the returned value of a file.
Parameters
- $path string
- $data array
requireOnce ( $path , array $data ) : mixed
Require the given file once.
Parameters
- $path string
- $data array
lines ( $path ) : LazyCollection
Get the contents of a file one line at a time.
Parameters
- $path string
hash ( $path ) : string
Get the MD5 hash of the file at the given path.
Parameters
- $path string
put ( $path , $contents , $lock ) : int|bool
Write the contents of a file.
Parameters
- $path string
- $contents string
- $lock bool
replace ( $path , $content ) : void
Write the contents of a file, replacing it atomically if it already exists.
Parameters
- $path string
- $content string
replaceInFile ( $search , $replace , $path ) : void
Replace a given string within a given file.
Parameters
- $search array|string
- $replace array|string
- $path string
prepend ( $path , $data ) : int
Prepend to a file.
Parameters
- $path string
- $data string
append ( $path , $data ) : int
Append to a file.
Parameters
- $path string
- $data string
chmod ( $path , $mode ) : mixed
Get or set UNIX mode of a file or directory.
Parameters
- $path string
- $mode int|null
delete ( $paths ) : bool
Delete the file at a given path.
Parameters
- $paths string|array
move ( $path , $target ) : bool
Move a file to a new location.
Parameters
- $path string
- $target string
copy ( $path , $target ) : bool
Copy a file to a new location.
Parameters
- $path string
- $target string
link ( $target , $link ) : void
Create a symlink to the target file or directory. On Windows, a hard link is created if the target is a file.
Parameters
- $target string
- $link string
relativeLink ( $target , $link ) : void
Create a relative symlink to the target file or directory.
Parameters
- $target string
- $link string
name ( $path ) : string
Extract the file name from a file path.
Parameters
- $path string
basename ( $path ) : string
Extract the trailing name component from a file path.
Parameters
- $path string
dirname ( $path ) : string
Extract the parent directory from a file path.
Parameters
- $path string
extension ( $path ) : string
Extract the file extension from a file path.
Parameters
- $path string
guessExtension ( $path ) : string|null
Guess the file extension from the mime-type of a given file.
Parameters
- $path string
type ( $path ) : string
Get the file type of a given file.
Parameters
- $path string
mimeType ( $path ) : string|false
Get the mime-type of a given file.
Parameters
- $path string
size ( $path ) : int
Get the file size of a given file.
Parameters
- $path string
lastModified ( $path ) : int
Get the file's last modification time.
Parameters
- $path string
isDirectory ( $directory ) : bool
Determine if the given path is a directory.
Parameters
- $directory string
isReadable ( $path ) : bool
Determine if the given path is readable.
Parameters
- $path string
isWritable ( $path ) : bool
Determine if the given path is writable.
Parameters
- $path string
isFile ( $file ) : bool
Determine if the given path is a file.
Parameters
- $file string
glob ( $pattern , $flags ) : array
Find path names matching a given pattern.
Parameters
- $pattern string
- $flags int
files ( $directory , $hidden ) : Symfony\...\SplFileInfo[]
Get an array of all files in a directory.
Parameters
- $directory string
- $hidden bool
allFiles ( $directory , $hidden ) : Symfony\...\SplFileInfo[]
Get all of the files from the given directory (recursive).
Parameters
- $directory string
- $hidden bool
directories ( $directory ) : array
Get all of the directories within a given directory.
Parameters
- $directory string
ensureDirectoryExists ( $path , $mode , $recursive ) : void
Ensure a directory exists.
Parameters
- $path string
- $mode int
- $recursive bool
makeDirectory ( $path , $mode , $recursive , $force ) : bool
Create a directory.
Parameters
- $path string
- $mode int
- $recursive bool
- $force bool
moveDirectory ( $from , $to , $overwrite ) : bool
Move a directory.
Parameters
- $from string
- $to string
- $overwrite bool
copyDirectory ( $directory , $destination , $options ) : bool
Copy a directory from one location to another.
Parameters
- $directory string
- $destination string
- $options int|null
deleteDirectory ( $directory , $preserve ) : bool
Recursively delete a directory.
Parameters
- $directory string
- $preserve bool
deleteDirectories ( $directory ) : bool
Remove all of the directories within a given directory.
Parameters
- $directory string
cleanDirectory ( $directory ) : bool
Empty the specified directory of all files and folders.
Parameters
- $directory string