|
|
@@ -48,7 +48,7 @@ class Zend_Service_Amazon_S3 extends Zend_Service_Amazon_Abstract
|
|
|
*/
|
|
|
protected static $_wrapperClients = array();
|
|
|
|
|
|
- const S3_ENDPOINT = 'http://s3.amazonaws.com';
|
|
|
+ const S3_ENDPOINT = 's3.amazonaws.com';
|
|
|
|
|
|
const S3_ACL_PRIVATE = 'private';
|
|
|
const S3_ACL_PUBLIC_READ = 'public-read';
|
|
|
@@ -246,14 +246,14 @@ class Zend_Service_Amazon_S3 extends Zend_Service_Amazon_Abstract
|
|
|
require_once 'Zend/Service/Amazon/S3/Exception.php';
|
|
|
throw new Zend_Service_Amazon_S3_Exception("Bucket name contains invalid characters");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(empty($nameparts[1])) {
|
|
|
return $object;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return $nameparts[0].'/'.urlencode($nameparts[1]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Get an object
|
|
|
*
|
|
|
@@ -386,7 +386,16 @@ class Zend_Service_Amazon_S3 extends Zend_Service_Amazon_Abstract
|
|
|
'Expect' => null,
|
|
|
'Range' => null,
|
|
|
'x-amz-acl' => null));
|
|
|
- $client->setUri(self::S3_ENDPOINT.'/'.$path);
|
|
|
+
|
|
|
+ // build the end point out
|
|
|
+ $parts = explode('/', $path);
|
|
|
+ if(count($parts) > 1) {
|
|
|
+ $endpoint = 'http://' . $parts[0] . '.' . self::S3_ENDPOINT;
|
|
|
+ array_shift($parts);
|
|
|
+ $client->setUri($endpoint . '/' . implode('/', $parts));
|
|
|
+ } else {
|
|
|
+ $client->setUri('http://' . self::S3_ENDPOINT.'/'.$path);
|
|
|
+ }
|
|
|
$client->setHeaders($headers);
|
|
|
|
|
|
if (is_array($params)) {
|
|
|
@@ -430,7 +439,7 @@ class Zend_Service_Amazon_S3 extends Zend_Service_Amazon_Abstract
|
|
|
* Add the S3 Authorization signature to the request headers
|
|
|
*
|
|
|
* @param string $method
|
|
|
- * @param string $path
|
|
|
+ * @param string $pathhttp://
|
|
|
* @param array &$headers
|
|
|
* @return string
|
|
|
*/
|