/** * Copy an item in the storage service to a given path. * * WARNING: This operation is *very* expensive for services that do not * support copying an item natively. * * @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 copyItem($sourcePath, $destinationPath, $options = array()) { try { $fullSourcePath = $this->_getFullPath($sourcePath, $options); $fullDestPath = $this->_getFullPath($destinationPath, $options); return $this->_s3->copyObject($fullSourcePath, $fullDestPath, empty($options[self::METADATA]) ? null : $options[self::METADATA]); } catch (\Zend\Service\Amazon\S3\Exception $e) { throw new Exception\RunTimeException('Error on copy: ' . $e->getMessage(), $e->getCode(), $e); } }