FileSystemStorage
class FileSystemStorage implements StorageInterface (View source)
A resource storage based on the (local) file system
Properties
protected string | $name | Name which identifies this resource storage |
|
protected string | $path | The path (in a filesystem) where resources are stored |
|
protected Environment | $environment | ||
protected ResourceManager | $resourceManager | ||
protected ResourceRepository | $resourceRepository |
Methods
Constructor
Initializes this resource storage
Returns the instance name of this storage
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
Retrieve all Objects stored in this storage.
Retrieve all Objects stored in this storage, filtered by the given collection name
Determines and returns the absolute path and filename for a storage file identified by the given SHA1 hash.
Details
__construct(string $name, array $options = [])
Constructor
void
initializeObject()
Initializes this resource storage
string
getName()
Returns the instance name of this storage
resource|bool
getStreamByResource(PersistentResource $resource)
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
resource|bool
getStreamByResourcePath(string $relativePath)
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
StorageObject>
getObjects(callable $callback = null)
Retrieve all Objects stored in this storage.
StorageObject>
getObjectsByCollection(CollectionInterface $collection, callable $callback = null)
Retrieve all Objects stored in this storage, filtered by the given collection name
protected string
getStoragePathAndFilenameByHash(string $sha1Hash)
Determines and returns the absolute path and filename for a storage file identified by the given SHA1 hash.
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.