Comments (7)
I have the same issue :)
I saw S3 class accept setting the $endpoint wich is the full url of each Region and with S3::getBucketLocation I was able to use a workaround and get the endpoint from the location using a simple array of locations and it's constraints:
$location = array('US' => 's3.amazonaws.com', 'us-west-1' => 's3-us-west-1.amazonaws.com', 'us-west-2' => 's3-us-west-2.amazonaws.com', 'EU' => 's3-eu-west-1.amazonaws.com', 'ap-southeast-1' => 's3-ap-southeast-1.amazonaws.com', 'ap-northeast-1' => 's3-ap-northeast-1.amazonaws.com', 'sa-east-1' => 's3-sa-east-1.amazonaws.com');
The tricky part is make it automatic, so I first must access the Bucket, retrieve the location and then again redeclare the class with the correct endpoint.
Unfortunatly, as Hurgh said, there are parts of the code where the endpoint is hard-coded.
For example the getAuthenticatedURL function (line 971) of 0.5.0-dev. My test with that part fixed were possitive. This is the code after the fix, quite easy:
$hostBucket ? $bucket : self::$endpoint.'/'.$bucket, $uri, self::$__accessKey, $expires,
I am available to help with the multi region feature if need it.
Cheers
from amazon-s3-php-class.
Miljan is correct - it is possible to access different locations, for example: S3::setEndpoint('s3-us-west-1.amazonaws.com');
This should be added to the documentation though.
from amazon-s3-php-class.
Still not working with a bucket located in Ireland.
Replaced all hardcoded adresses and setEndpoint, it doesn't work, but does with a north america bucket.
from amazon-s3-php-class.
What is the endpoint you are using?
from amazon-s3-php-class.
s3-website-eu-west-1.amazonaws.com
from amazon-s3-php-class.
Try S3::setEndpoint('s3-eu-west-1.amazonaws.com'); ?
from amazon-s3-php-class.
Okay that worked, thanks.
I would be nice to detect the regional endpoint of the bucket like the official sdk does.
from amazon-s3-php-class.
Related Issues (20)
- S3.php uses AWS API that will be deprecated on June 6th 2019
- SignatureDoesNotMatch error HOT 2
- Easy fix for getObjectInfo bug
- Missing setSignatureVersion function HOT 1
- Issue on uploading in Asia Mumbai region bucket.
- S3.php is huge and is becoming unmanageable :(
- putObject problem
- AuthorizationHeaderMalformed: the region 'us-east-1' is wrong; expecting 'ap-northeast-1' HOT 3
- Access denied on deleteObject
- error messages
- Could I prevent invalidation?
- ListBuckets does not work on non-amazon services HOT 12
- Install region eu-west-1 default
- Does it support tagging? HOT 1
- Haveing 2 buckets in the same region
- Deprecated: Array and string offset access syntax with curly braces
- openssl_free_key() is deprecated in PHP8
- De-static-ified version of S3 with tagging
- PHP 8 Issues HOT 2
- How To Get Public URL Of Object After Uploading A File Object?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-s3-php-class.