PHP Interface Kraken\Filesystem\FilesystemInterface

Afficher le fichier Open project: kraken-php/framework Interface Usage Examples

Méthodes publiques

Méthode Description
append ( string $path, string $contents ) Appends contents to file.
copyDir ( string $source, string $destination ) Copy a directory.
copyFile ( string $source, string $destination ) Copy a file.
create ( string $path, string $contents ) Create a new file or overwrite existing one.
createDir ( string $dirname, string $visibility = Filesystem::VISIBILITY_DEFAULT ) Create a directory.
createFile ( string $path, string $contents = '', string $visibility = Filesystem::VISIBILITY_DEFAULT ) Create a new file.
eraseDir ( string $dirname = '' ) Erase a directory.
eraseFile ( string $path ) Erase a file.
exists ( string $path ) : boolean Check whether a file or directory exist.
getContents ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array List contents of a directory.
getDirectories ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array List directories of a directory.
getFiles ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array List files of a directory.
getMimetype ( string $path ) : string Get mimetype of a file.
getSize ( $path ) : integer Returns size of a file.
getTimestamp ( string $path ) : string Get timestamp of a file.
getType ( string $path ) : string Get type of a file.
getVisibility ( string $path ) : string Get visibility of a file or directory.
isDir ( string $path ) : boolean Check if path is a file.
isFile ( string $path ) : boolean Check if path is a file.
isPrivate ( string $path = '' ) : boolean Check if file or directory is private.
isPublic ( string $path = '' ) : boolean Check if file or directory is public.
move ( string $source, string $destination ) Move (rename) a file or directory.
prepend ( string $path, string $contents ) Prepends contents to file.
read ( string $path ) : string Read a file.
removeDir ( string $dirname ) Remove a directory.
removeFile ( string $path ) Remove a file.
req ( string $path ) : mixed Require a file.
setPrivate ( string $path = '' ) Sets visibility of file or directory to private.
setPublic ( string $path = '' ) Sets visibility of file or directory to public.
setVisibility ( string $path, string $visibility ) Set visibility of a file or directory.
write ( string $path, string $contents ) Overwrite existing file.

Method Details

append() public méthode

Appends contents to file.
public append ( string $path, string $contents )
$path string
$contents string

copyDir() public méthode

Copy a directory.
public copyDir ( string $source, string $destination )
$source string
$destination string

copyFile() public méthode

Copy a file.
public copyFile ( string $source, string $destination )
$source string
$destination string

create() public méthode

Create a new file or overwrite existing one.
public create ( string $path, string $contents )
$path string
$contents string

createDir() public méthode

Create a directory.
public createDir ( string $dirname, string $visibility = Filesystem::VISIBILITY_DEFAULT )
$dirname string
$visibility string

createFile() public méthode

Create a new file.
public createFile ( string $path, string $contents = '', string $visibility = Filesystem::VISIBILITY_DEFAULT )
$path string
$contents string
$visibility string

eraseDir() public méthode

Erase a directory.
public eraseDir ( string $dirname = '' )
$dirname string

eraseFile() public méthode

Erase a file.
public eraseFile ( string $path )
$path string

exists() public méthode

Check whether a file or directory exist.
public exists ( string $path ) : boolean
$path string
Résultat boolean

getContents() public méthode

List contents of a directory.
public getContents ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array
$directory string
$recursive boolean
$filterPatterns string | string[]
Résultat array

getDirectories() public méthode

List directories of a directory.
public getDirectories ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array
$directory string
$recursive boolean
$filterPatterns string | string[]
Résultat array

getFiles() public méthode

List files of a directory.
public getFiles ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array
$directory string
$recursive boolean
$filterPatterns string | string[]
Résultat array

getMimetype() public méthode

Get mimetype of a file.
public getMimetype ( string $path ) : string
$path string
Résultat string

getSize() public méthode

Returns size of a file.
public getSize ( $path ) : integer
$path
Résultat integer

getTimestamp() public méthode

Get timestamp of a file.
public getTimestamp ( string $path ) : string
$path string
Résultat string

getType() public méthode

Get type of a file.
public getType ( string $path ) : string
$path string
Résultat string

getVisibility() public méthode

Get visibility of a file or directory.
public getVisibility ( string $path ) : string
$path string
Résultat string

isDir() public méthode

Check if path is a file.
public isDir ( string $path ) : boolean
$path string
Résultat boolean

isFile() public méthode

Check if path is a file.
public isFile ( string $path ) : boolean
$path string
Résultat boolean

isPrivate() public méthode

Check if file or directory is private.
public isPrivate ( string $path = '' ) : boolean
$path string
Résultat boolean

isPublic() public méthode

Check if file or directory is public.
public isPublic ( string $path = '' ) : boolean
$path string
Résultat boolean

move() public méthode

Move (rename) a file or directory.
public move ( string $source, string $destination )
$source string
$destination string

prepend() public méthode

Prepends contents to file.
public prepend ( string $path, string $contents )
$path string
$contents string

read() public méthode

Read a file.
public read ( string $path ) : string
$path string
Résultat string

removeDir() public méthode

Remove a directory.
public removeDir ( string $dirname )
$dirname string

removeFile() public méthode

Remove a file.
public removeFile ( string $path )
$path string

req() public méthode

Require a file.
public req ( string $path ) : mixed
$path string
Résultat mixed

setPrivate() public méthode

Sets visibility of file or directory to private.
public setPrivate ( string $path = '' )
$path string

setPublic() public méthode

Sets visibility of file or directory to public.
public setPublic ( string $path = '' )
$path string

setVisibility() public méthode

Set visibility of a file or directory.
public setVisibility ( string $path, string $visibility )
$path string
$visibility string

write() public méthode

Overwrite existing file.
public write ( string $path, string $contents )
$path string
$contents string