Code Monkey home page Code Monkey logo

Comments (7)

miljan-aleksic avatar miljan-aleksic commented on July 24, 2024

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.

tpyo avatar tpyo commented on July 24, 2024

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.

younes0 avatar younes0 commented on July 24, 2024

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.

tpyo avatar tpyo commented on July 24, 2024

What is the endpoint you are using?

from amazon-s3-php-class.

younes0 avatar younes0 commented on July 24, 2024

s3-website-eu-west-1.amazonaws.com

from amazon-s3-php-class.

tpyo avatar tpyo commented on July 24, 2024

Try S3::setEndpoint('s3-eu-west-1.amazonaws.com'); ?

from amazon-s3-php-class.

younes0 avatar younes0 commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.