Neos\Flow\ResourceManagement\PersistentResource::getStream PHP Метод

getStream() публичный Метод

Note: The caller is responsible to close the returned resource by calling fclose($stream)
public getStream ( ) : resource | boolean
Результат resource | boolean | boolean A stream which points to the data of this resource for read-access or FALSE if the stream could not be obtained
    public function getStream()
    {
        return $this->resourceManager->getStreamByResource($this);
    }

Usage Example

 /**
  * Publishes the given persistent resource from the given storage
  *
  * @param PersistentResource $resource The resource to publish
  * @param CollectionInterface $collection The collection the given resource belongs to
  * @return void
  */
 public function publishResource(PersistentResource $resource, CollectionInterface $collection)
 {
     $sourceStream = $resource->getStream();
     if ($sourceStream === false) {
         $this->handleMissingData($resource, $collection);
         return;
     }
     $this->publishFile($sourceStream, $this->getRelativePublicationPathAndFilename($resource));
     fclose($sourceStream);
 }
All Usage Examples Of Neos\Flow\ResourceManagement\PersistentResource::getStream