示例#1
0
文件: S3.php 项目: rafalwrzeszcz/zf2
 /**
  * Move an item in the storage service to a given path.
  *
  * @TODO Support streams for those services that don't support natively
  *
  * @param  string $sourcePath
  * @param  string $destination path
  * @param  array $options
  * @return void
  */
 public function moveItem($sourcePath, $destinationPath, $options = array())
 {
     try {
         $fullSourcePath = $this->_getFullPath($sourcePath, $options);
         $fullDestPath = $this->_getFullPath($destinationPath, $options);
         return $this->_s3->moveObject($fullSourcePath, $fullDestPath, empty($options[self::METADATA]) ? null : $options[self::METADATA]);
     } catch (Zend\Service\Amazon\S3\Exception $e) {
         throw new Exception\RuntimeException('Error on move: ' . $e->getMessage(), $e->getCode(), $e);
     }
 }