Exemple #1
0
 /**
  * @return resource
  */
 public function getResource()
 {
     if (!$this->mode) {
         throw new \Filicious\Exception\StreamException('Stream not open!');
         // TODO
     }
     if ($this->streamIndex === null) {
         $this->streamIndex = StreamManager::registerStream($this);
     }
     return $this->selfResource = fopen('filicious-streams://' . $this->streamIndex, $this->mode->getMode());
 }
Exemple #2
0
 /**
  * Disable streaming for this filesystem.
  *
  * @throws Exception\StreamWrapperNotRegisteredException
  */
 public function disableStreaming()
 {
     if ($this->streamHost) {
         StreamManager::unregisterFilesystem($this->streamHost, $this->streamScheme);
         $this->streamHost = null;
         $this->streamScheme = null;
     }
 }