public getStreamByResource ( |
||
$resource | The resource stored in this storage | |
return | resource | boolean | | boolean The resource stream or FALSE if the stream could not be obtained |
public function getStreamByResource(PersistentResource $resource)
{
$pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());
return file_exists($pathAndFilename) ? fopen($pathAndFilename, 'rb') : false;
}