PHP Class Pagekit\Filesystem\Filesystem

Datei anzeigen Open project: pagekit/pagekit Class Usage Examples

Protected Properties

Property Type Description
$adapters Pagekit\Filesystem\Adapter\AdapterInterface[]

Public Methods

Method Description
copy ( string $source, string $target ) : boolean Copies a file.
copyDir ( string $source, string $target ) : boolean Copies a directory.
delete ( string | array $files ) : boolean Deletes a file.
exists ( string | array $files ) : boolean Checks whether a file or directory exists.
getAdapter ( string $protocol ) : Pagekit\Filesystem\Adapter\AdapterInterface | null Gets a adapter.
getPath ( string $file, boolean $local = false ) : string | false Gets canonicalized file path or localpath.
getPathInfo ( string $file, string $option = null ) : string | array Gets file path info.
getUrl ( string $file, mixed $referenceType = UrlGenerator::ABSOLUTE_PATH ) : string | false Gets file path URL.
listDir ( string $dir ) : array List files and directories inside the specified path.
makeDir ( string $dir, integer $mode = 511, boolean $recursive = true ) : boolean Makes a directory.
registerAdapter ( string $protocol, Pagekit\Filesystem\Adapter\AdapterInterface $adapter ) Registers a adapter.

Method Details

copy() public method

Copies a file.
public copy ( string $source, string $target ) : boolean
$source string
$target string
return boolean

copyDir() public method

Copies a directory.
public copyDir ( string $source, string $target ) : boolean
$source string
$target string
return boolean

delete() public method

Deletes a file.
public delete ( string | array $files ) : boolean
$files string | array
return boolean

exists() public method

Checks whether a file or directory exists.
public exists ( string | array $files ) : boolean
$files string | array
return boolean

getAdapter() public method

Gets a adapter.
public getAdapter ( string $protocol ) : Pagekit\Filesystem\Adapter\AdapterInterface | null
$protocol string
return Pagekit\Filesystem\Adapter\AdapterInterface | null

getPath() public method

Gets canonicalized file path or localpath.
public getPath ( string $file, boolean $local = false ) : string | false
$file string
$local boolean
return string | false

getPathInfo() public method

Gets file path info.
public getPathInfo ( string $file, string $option = null ) : string | array
$file string
$option string
return string | array

getUrl() public method

Gets file path URL.
public getUrl ( string $file, mixed $referenceType = UrlGenerator::ABSOLUTE_PATH ) : string | false
$file string
$referenceType mixed
return string | false

listDir() public method

List files and directories inside the specified path.
public listDir ( string $dir ) : array
$dir string
return array

makeDir() public method

Makes a directory.
public makeDir ( string $dir, integer $mode = 511, boolean $recursive = true ) : boolean
$dir string
$mode integer
$recursive boolean
return boolean

registerAdapter() public method

Registers a adapter.
public registerAdapter ( string $protocol, Pagekit\Filesystem\Adapter\AdapterInterface $adapter )
$protocol string
$adapter Pagekit\Filesystem\Adapter\AdapterInterface

Property Details

$adapters protected_oe property

protected AdapterInterface[],Pagekit\Filesystem\Adapter $adapters
return Pagekit\Filesystem\Adapter\AdapterInterface[]