File¶
-
php\io\File
Class File
Constants
Methods
__construct
($path, $child = NULL)¶
Parameters:
- $path – string
- $child – null, string
exists
()¶
Returns: bool
canExecute
()¶
Returns: bool
canWrite
()¶
Returns: bool
canRead
()¶
Returns: bool
getName
()¶
Returns: string
getAbsolutePath
()¶
Returns: string
getCanonicalPath
()¶throws php\io\IOException
Returns: string
getParent
()¶
Returns: string
getPath
()¶
Returns: string
getAbsoluteFile
()¶
Returns: php\io\File
getCanonicalFile
()¶throws php\io\IOException
Returns: php\io\File
getParentFile
()¶
Returns: php\io\File
mkdir
()¶
Returns: bool
mkdirs
()¶
Returns: bool
isFile
()¶
Returns: bool
isDirectory
()¶
Returns: bool
isAbsolute
()¶
Returns: bool
isHidden
()¶
Returns: bool
matches
($pattern)¶
Parameters:
- $pattern – string - the “glob” and “regex” syntaxes, and may support others.
Returns: bool
delete
()¶
Returns: bool
deleteOnExit
()¶
Returns: void
createNewFile
($withDirs = false)¶
Parameters:
- $withDirs – bool
Returns: bool
lastModified
()¶
Returns: int
length
()¶
Returns: int
crc32
()¶
Returns: int, null null if not exists or io exception
hash
($algorithm = 'MD5')¶
Parameters:
- $algorithm – string
Returns: string, null if not exists or io exception
renameTo
($newName)¶
Parameters:
- $newName – string
Returns: bool
setExecutable
($value, $ownerOnly = true)¶
Parameters:
- $value – bool
- $ownerOnly – bool
Returns: bool
setWritable
($value, $ownerOnly = true)¶
Parameters:
- $value – bool
- $ownerOnly – bool
Returns: bool
setReadable
($value, $ownerOnly = true)¶
Parameters:
- $value – bool
- $ownerOnly – bool
Returns: bool
setReadOnly
()¶
Returns: bool
setLastModified
($time)¶
Parameters:
- $time – int
Returns: bool
compareTo
($file)¶
Parameters:
- $file – string, php\io\File
Returns: int
find
($filter = null)¶throws php\io\IOException
Parameters:
- $filter – callable
Returns: string[]
findFiles
($filter = null)¶throws php\io\IOException
Parameters:
- $filter – callable - (File $directory, $name)
Returns:
- static
createTemp
($prefix, $suffix, $directory = null)¶
Parameters:
- $prefix – string
- $suffix – string
- $directory – null, php\io\File, string
Returns:
- static
listRoots
¶List the available filesystem roots. Returns an array of objects denoting the available filesystem roots, or empty array if the set of roots could not be determined. The array will be empty if there are no filesystem roots.
Returns: php\io\File[]
- static
of
($path)¶
Parameters:
- $path – string
Returns: