PHP Class Neos\Flow\ResourceManagement\Storage\FileSystemStorage

Inheritance: implements Neos\Flow\ResourceManagement\Storage\StorageInterface
Afficher le fichier Open project: neos/flow-development-collection

Protected Properties

Свойство Type Description
$environment Neos\Flow\Utility\Environment
$name string Name which identifies this resource storage
$path string The path (in a filesystem) where resources are stored
$resourceManager Neos\Flow\ResourceManagement\ResourceManager
$resourceRepository Neos\Flow\ResourceManagement\ResourceRepository

Méthodes publiques

Méthode Description
__construct ( string $name, array $options = [] ) Constructor
getName ( ) : string Returns the instance name of this storage
getObjects ( callable $callback = null ) : Generator Retrieve all Objects stored in this storage.
getObjectsByCollection ( Neos\Flow\ResourceManagement\CollectionInterface $collection, callable $callback = null ) : Generator Retrieve all Objects stored in this storage, filtered by the given collection name
getStreamByResource ( PersistentResource $resource ) : resource | boolean Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
getStreamByResourcePath ( string $relativePath ) : resource | boolean Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
initializeObject ( ) : void Initializes this resource storage

Méthodes protégées

Méthode Description
getStoragePathAndFilenameByHash ( string $sha1Hash ) : string Determines and returns the absolute path and filename for a storage file identified by the given SHA1 hash.

Method Details

__construct() public méthode

Constructor
public __construct ( string $name, array $options = [] )
$name string Name of this storage instance, according to the resource settings
$options array Options for this storage

getName() public méthode

Returns the instance name of this storage
public getName ( ) : string
Résultat string

getObjects() public méthode

Retrieve all Objects stored in this storage.
public getObjects ( callable $callback = null ) : Generator
$callback callable Function called after each iteration
Résultat Generator

getObjectsByCollection() public méthode

Retrieve all Objects stored in this storage, filtered by the given collection name
public getObjectsByCollection ( Neos\Flow\ResourceManagement\CollectionInterface $collection, callable $callback = null ) : Generator
$collection Neos\Flow\ResourceManagement\CollectionInterface
$callback callable Function called after each iteration
Résultat Generator

getStoragePathAndFilenameByHash() protected méthode

This function assures a nested directory structure in order to avoid thousands of files in a single directory which may result in performance problems in older file systems such as ext2, ext3 or NTFS.
protected getStoragePathAndFilenameByHash ( string $sha1Hash ) : string
$sha1Hash string The SHA1 hash identifying the stored resource
Résultat string The path and filename, for example "/var/www/mysite.com/Data/Persistent/c/8/2/8/c828d0f88ce197be1aff7cc2e5e86b1244241ac6"

getStreamByResource() public méthode

Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
public getStreamByResource ( PersistentResource $resource ) : resource | boolean
$resource Neos\Flow\ResourceManagement\PersistentResource The resource stored in this storage
Résultat resource | boolean | boolean The resource stream or FALSE if the stream could not be obtained

getStreamByResourcePath() public méthode

Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
public getStreamByResourcePath ( string $relativePath ) : resource | boolean
$relativePath string A path relative to the storage root, for example "MyFirstDirectory/SecondDirectory/Foo.css"
Résultat resource | boolean | boolean A URI (for example the full path and filename) leading to the resource file or FALSE if it does not exist

initializeObject() public méthode

Initializes this resource storage
public initializeObject ( ) : void
Résultat void

Property Details

$environment protected_oe property

protected Environment,Neos\Flow\Utility $environment
Résultat Neos\Flow\Utility\Environment

$name protected_oe property

Name which identifies this resource storage
protected string $name
Résultat string

$path protected_oe property

The path (in a filesystem) where resources are stored
protected string $path
Résultat string

$resourceManager protected_oe property

protected ResourceManager,Neos\Flow\ResourceManagement $resourceManager
Résultat Neos\Flow\ResourceManagement\ResourceManager

$resourceRepository protected_oe property

protected ResourceRepository,Neos\Flow\ResourceManagement $resourceRepository
Résultat Neos\Flow\ResourceManagement\ResourceRepository