PHP Интерфейс Kraken\Filesystem\FilesystemInterface

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

append() публичный Метод

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

copyDir() публичный Метод

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

copyFile() публичный Метод

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

create() публичный Метод

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

createDir() публичный Метод

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

createFile() публичный Метод

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

eraseDir() публичный Метод

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

eraseFile() публичный Метод

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

exists() публичный Метод

Check whether a file or directory exist.
public exists ( string $path ) : boolean
$path string
Результат boolean

getContents() публичный Метод

List contents of a directory.
public getContents ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array
$directory string
$recursive boolean
$filterPatterns string | string[]
Результат array

getDirectories() публичный Метод

List directories of a directory.
public getDirectories ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array
$directory string
$recursive boolean
$filterPatterns string | string[]
Результат array

getFiles() публичный Метод

List files of a directory.
public getFiles ( string $directory = '', boolean $recursive = false, string | string[] $filterPatterns = [] ) : array
$directory string
$recursive boolean
$filterPatterns string | string[]
Результат array

getMimetype() публичный Метод

Get mimetype of a file.
public getMimetype ( string $path ) : string
$path string
Результат string

getSize() публичный Метод

Returns size of a file.
public getSize ( $path ) : integer
$path
Результат integer

getTimestamp() публичный Метод

Get timestamp of a file.
public getTimestamp ( string $path ) : string
$path string
Результат string

getType() публичный Метод

Get type of a file.
public getType ( string $path ) : string
$path string
Результат string

getVisibility() публичный Метод

Get visibility of a file or directory.
public getVisibility ( string $path ) : string
$path string
Результат string

isDir() публичный Метод

Check if path is a file.
public isDir ( string $path ) : boolean
$path string
Результат boolean

isFile() публичный Метод

Check if path is a file.
public isFile ( string $path ) : boolean
$path string
Результат boolean

isPrivate() публичный Метод

Check if file or directory is private.
public isPrivate ( string $path = '' ) : boolean
$path string
Результат boolean

isPublic() публичный Метод

Check if file or directory is public.
public isPublic ( string $path = '' ) : boolean
$path string
Результат boolean

move() публичный Метод

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

prepend() публичный Метод

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

read() публичный Метод

Read a file.
public read ( string $path ) : string
$path string
Результат string

removeDir() публичный Метод

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

removeFile() публичный Метод

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

req() публичный Метод

Require a file.
public req ( string $path ) : mixed
$path string
Результат mixed

setPrivate() публичный Метод

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

setPublic() публичный Метод

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

setVisibility() публичный Метод

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

write() публичный Метод

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