PHP Class Jarves\Filesystem\Filesystem

Inheritance: implements Jarves\Filesystem\FilesystemInterface
Afficher le fichier Open project: jarves/jarves Class Usage Examples

Protected Properties

Свойство Type Description
$adapter Jarves\Filesystem\Adapter\AdapterInterface

Méthodes publiques

Méthode Description
checkFileValues ( FileInfo $file, File $databaseFile )
copy ( $source, $target )
createFromPathInfo ( Jarves\File\FileInfoInterface $fileInfo )
delete ( string $path ) : boolean
filemtime ( $path )
getAdapter ( string | null $path = null ) : Jarves\Filesystem\Adapter\AdapterInterface
getCount ( string $folderPath ) : mixed Returns the file count inside $folderPath
getFile ( string $path ) : Jarves\File\FileInfoInterface Return information for a file/folder.
getFiles ( string $path ) : File[] List directory contents.
getResizeMax ( string $path, integer $width, integer $height ) : PHPImageWorkshop\Core\ImageWorkshopLayer Resize a image and returns it's object.
getThumbnail ( string $path, string $resolution, boolean $resize = false ) : resource
handle ( string $path ) : resource
has ( string $path ) : boolean
hash ( $path )
mkdir ( $path )
move ( $source, $target )
normalizePath ( string | array $path ) : string Removes the name of the mount point from the proper layer.
read ( string $path ) : string
remove ( string $path ) : boolean
rename ( $source, $target )
search ( $path, $q, $depth ) : array
setAdapter ( Jarves\Filesystem\Adapter\AdapterInterface $adapter )
write ( string $path, string $content = '' ) : boolean
writeImage ( resource $image, string $path, integer $quality = 8 ) : boolean

Method Details

checkFileValues() public méthode

public checkFileValues ( FileInfo $file, File $databaseFile )
$file Jarves\File\FileInfo
$databaseFile Jarves\Model\File

copy() public méthode

public copy ( $source, $target )

createFromPathInfo() public méthode

public createFromPathInfo ( Jarves\File\FileInfoInterface $fileInfo )
$fileInfo Jarves\File\FileInfoInterface

delete() public méthode

public delete ( string $path ) : boolean
$path string
Résultat boolean

filemtime() public méthode

public filemtime ( $path )

getAdapter() public méthode

public getAdapter ( string | null $path = null ) : Jarves\Filesystem\Adapter\AdapterInterface
$path string | null
Résultat Jarves\Filesystem\Adapter\AdapterInterface

getCount() public méthode

Returns the file count inside $folderPath
public getCount ( string $folderPath ) : mixed
$folderPath string
Résultat mixed

getFile() public méthode

The result contains following information: [path(relative), name, type(dir|file), ctime(unixtimestamp), mtime(unixtimestamp), size(bytes)] array( path => path to this file/folder for usage in the administration and modules. Not the full http path. No trailing slash! name => basename(path) ctime => as unix timestamps mtime => as unix timestamps size => filesize in bytes (not for folders) type => 'dir' or 'file' )
public getFile ( string $path ) : Jarves\File\FileInfoInterface
$path string
Résultat Jarves\File\FileInfoInterface

getFiles() public méthode

Same as in getFile() but in a list. array( array( path => path to the file/folder for usage in the administration and modules. Not the full http path. No trailing slash! name => basename(path) ctime => as unix timestamps mtime => as unix timestamps size => filesize in bytes (not for folders) type => 'file' | 'dir' mount => boolean (if the folder is a mount point) ) )
public getFiles ( string $path ) : File[]
$path string
Résultat Jarves\Model\File[]

getResizeMax() public méthode

Resize a image and returns it's object.
public getResizeMax ( string $path, integer $width, integer $height ) : PHPImageWorkshop\Core\ImageWorkshopLayer
$path string
$width integer
$height integer
Résultat PHPImageWorkshop\Core\ImageWorkshopLayer

getThumbnail() public méthode

public getThumbnail ( string $path, string $resolution, boolean $resize = false ) : resource
$path string
$resolution string x
$resize boolean
Résultat resource

handle() public méthode

public handle ( string $path ) : resource
$path string
Résultat resource

has() public méthode

public has ( string $path ) : boolean
$path string
Résultat boolean

hash() public méthode

public hash ( $path )

mkdir() public méthode

public mkdir ( $path )

move() public méthode

public move ( $source, $target )

normalizePath() public méthode

Also removes '..' and replaces '//' => '/' This is needed because the file layer gets the relative path under his own root. Forces a / at the beginning, removes the trailing / if exists.
public normalizePath ( string | array $path ) : string
$path string | array
Résultat string

read() public méthode

public read ( string $path ) : string
$path string
Résultat string

remove() public méthode

public remove ( string $path ) : boolean
$path string
Résultat boolean

rename() public méthode

public rename ( $source, $target )

setAdapter() public méthode

public setAdapter ( Jarves\Filesystem\Adapter\AdapterInterface $adapter )
$adapter Jarves\Filesystem\Adapter\AdapterInterface

write() public méthode

public write ( string $path, string $content = '' ) : boolean
$path string
$content string
Résultat boolean

writeImage() public méthode

public writeImage ( resource $image, string $path, integer $quality = 8 ) : boolean
$image resource
$path string
$quality integer between 0 and 10
Résultat boolean

Property Details

$adapter protected_oe property

protected AdapterInterface,Jarves\Filesystem\Adapter $adapter
Résultat Jarves\Filesystem\Adapter\AdapterInterface