PHP Class Jarves\Filesystem\WebFilesystem

Inheritance: extends Filesystem
Exibir arquivo Open project: jarves/jarves Class Usage Examples

Protected Properties

Property Type Description
$adapterInstances array
$jarves Jarves\Jarves

Public Methods

Method Description
__construct ( Jarves $jarves, JarvesConfig $jarvesConfig, Symfony\Component\DependencyInjection\ContainerInterface $container, Filesystem $cacheFilesystem )
copy ( $source, $target )
copyFolder ( $from, $to )
createTempFolder ( string $prefix = '', boolean $fullPath = true ) : string Creates a temp folder and returns its path.
downloadFolder ( $path, $to = null )
getAdapter ( string $path = null ) : Jarves\Filesystem\Adapter\AdapterInterface
getFile ( $path ) : Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | File
getFiles ( string $path ) : File[]
getPath ( integer | string $id ) : string Translates the internal id to the real path.
move ( $source, $target )
newAdapter ( string $serviceId, string $mountPath, array $params ) : Jarves\Filesystem\Adapter\AdapterInterface
paste ( array | string $source, string $target, string $action = 'move' ) : boolean Copies or moves files to a destination.
wrap ( Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] $fileInfo ) : Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | File Returns a File object. If the file behind the file's 'path' does not exists in the database, it will be created.

Method Details

__construct() public method

public __construct ( Jarves $jarves, JarvesConfig $jarvesConfig, Symfony\Component\DependencyInjection\ContainerInterface $container, Filesystem $cacheFilesystem )
$jarves Jarves\Jarves
$jarvesConfig Jarves\JarvesConfig
$container Symfony\Component\DependencyInjection\ContainerInterface
$cacheFilesystem Filesystem

copy() public method

public copy ( $source, $target )

copyFolder() public method

public copyFolder ( $from, $to )

createTempFolder() public method

Please use TempFile::createFolder() class instead.
public createTempFolder ( string $prefix = '', boolean $fullPath = true ) : string
$prefix string
$fullPath boolean Returns the full path on true and the relative to the current TempFolder on false.
return string Path with trailing slash

downloadFolder() public method

public downloadFolder ( $path, $to = null )

getAdapter() public method

public getAdapter ( string $path = null ) : Jarves\Filesystem\Adapter\AdapterInterface
$path string
return Jarves\Filesystem\Adapter\AdapterInterface

getFile() public method

public getFile ( $path ) : Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | File
return Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | Jarves\Model\File

getFiles() public method

public getFiles ( string $path ) : File[]
$path string
return Jarves\Model\File[]

getPath() public method

Example: getPath(45) => '/myImageFolder/Picture1.png'
public getPath ( integer | string $id ) : string
$id integer | string String for backward compatibility
return string

move() public method

public move ( $source, $target )

newAdapter() public method

public newAdapter ( string $serviceId, string $mountPath, array $params ) : Jarves\Filesystem\Adapter\AdapterInterface
$serviceId string
$mountPath string
$params array
return Jarves\Filesystem\Adapter\AdapterInterface

paste() public method

If the source is a folder, it copies recursively.
public paste ( array | string $source, string $target, string $action = 'move' ) : boolean
$source array | string
$target string
$action string move|copy
return boolean

wrap() public method

This maintains the file references. Jarves does not store the actual path in references but an ID. This ID is related to the path. If a file path is changed we need only to change one place (system_file table) instead of all references.
public wrap ( Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] $fileInfo ) : Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | File
$fileInfo Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[]
return Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | Jarves\Model\File

Property Details

$adapterInstances protected_oe property

protected array $adapterInstances
return array

$jarves protected_oe property

protected Jarves,Jarves $jarves
return Jarves\Jarves