コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function replace($destination)
 {
     if (empty($this->name)) {
         throw new ObjectException("Unable to replace unassigned storage object.");
     }
     if (is_string($destination)) {
         $destination = $this->storage->bucket($destination);
     }
     $this->address = $this->bucket->replace($destination, $this->name);
     $this->bucket = $destination;
     return $this;
 }
コード例 #2
0
ファイル: StorageBucket.php プロジェクト: jwdeitch/components
 /**
  * {@inheritdoc}
  */
 public function put($name, $source)
 {
     $this->logger()->info("Put '{$this->buildAddress($name)}' at '{$this->getServerID()}' server.");
     if ($source instanceof UploadedFileInterface || $source instanceof StreamableInterface) {
         //Known simplification for UploadedFile
         $source = $source->getStream();
     }
     if (is_resource($source)) {
         $source = \GuzzleHttp\Psr7\stream_for($source);
     }
     $benchmark = $this->benchmark($this->getServerID(), "put::{$this->buildAddress($name)}");
     $this->server()->put($this, $name, $source);
     $this->benchmark($benchmark);
     return $this->storage->open($this->buildAddress($name));
 }