# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /var/www/Zendframework/library/Zend/Service/Amazon # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: S3.php --- S3.php Base (BASE) +++ S3.php Locally Modified (Based On LOCAL) @@ -424,6 +424,32 @@ } /** + * Copy an object to a new object (PUT Object (Copy)) + * + * @param string $source Object name + * @param string $destination Object name + * @param string $directive RELPACE/COPY + * @param array $meta Metadata + * @return boolean + */ + public function copyObject($source, $destination, $directive='REPLACE', $meta=null) + { + $destination = $this->_fixupObjectName($destination); + $headers = (is_array($meta)) ? $meta : array(); + + $headers['x-amz-copy-source'] = urlencode($source); + $headers['x-amz-metadata-directive'] = $directive; + + $response = $this->_makeRequest('PUT', $destination, null, $headers); + + // Check the MD5 Etag returned by S3 against and MD5 of the buffer + if ($response->getStatus() == 200) { + return true; + } + return false; + } + + /** * Put file to S3 as object * * @param string $path File name