Skip to content

Conversation

gigablah
Copy link
Contributor

I noticed Amazon released version 2 of their PHP SDK a while back, so I added support for it.

The changes include:

  • Moving Respect/Rest to the "suggest" section in composer.json, since some people may not want to use the REST server, or wish to implement it themselves
  • Added the PEAR repository definition, which is required for microsoft/windowsazure
  • Bumped the Monolog version for compatibility with newer Symfony2 libraries (the new AWS SDK depends on the Symfony2 event dispatcher and Guzzle)
  • Added AmazonSQSV2 and AmazonS3V2 Backend classes, which use the new library functions
  • Added Base::setConnection(), which enables dependency injection (e.g. someone might want to pass an existing connection object to a backend instance)
  • Added tests for the new classes and functions

What do you think? I thought of simply replacing the AWS classes, but some people might want to stay with the old SDK. Maybe do it in a different version branch?

@miccheng
Copy link
Member

Wow! Yeah, was waiting for the support to be mature on V2.

Was wondering if its possible to keep to the same backend class name & auto detect the presence of V1 or V2 and use the appropriate libraries.

@gigablah
Copy link
Contributor Author

Hm, I could make a proxy class:

src/PHPQueue/Backend/AmazonS3.php
src/PHPQueue/Backend/AmazonS3V1.php
src/PHPQueue/Backend/AmazonS3V2.php

AmazonS3 will detect which version of the SDK is present and instantiate either AmazonS3V1 or AmazonS3V2, then proxy the function calls.

Maybe have another namespace level to avoid clutter:

src/PHPQueue/Backend/AmazonS3.php
src/PHPQueue/Backend/Aws/AmazonS3V1.php
src/PHPQueue/Backend/Aws/AmazonS3V2.php

Your thoughts?

@miccheng
Copy link
Member

Awesome! Sounds like a plan!

On Friday, May 31, 2013, Chris Heng wrote:

Hm, I could make a proxy class:

src/PHPQueue/Backend/AmazonS3.php
src/PHPQueue/Backend/AmazonS3V1.php
src/PHPQueue/Backend/AmazonS3V2.php

AmazonS3 will detect which version of the SDK is present and instantiate
either AmazonS3V1 or AmazonS3V2, then proxy the function calls.

Maybe have another namespace level to avoid clutter:

src/PHPQueue/Backend/AmazonS3.php
src/PHPQueue/Backend/Aws/AmazonS3V1.php
src/PHPQueue/Backend/Aws/AmazonS3V2.php

Your thoughts?


Reply to this email directly or view it on GitHubhttps://github.com//pull/16#issuecomment-18717461
.

Regards,

Michael Cheng CM
Mobile: +65 9185 5166
LinkedIn: http://sg.linkedin.com/in/miccheng

@gigablah
Copy link
Contributor Author

I've added a Proxy base class which AmazonS3 and AmazonSQS extends. They will now instantiate the proper concrete backend class based on SDK availability. (You can also force a specific SDK version by injecting the backend manually, which is done in the PHPUnit tests).

miccheng added a commit that referenced this pull request May 31, 2013
Added support for AWS PHP SDK version 2. Used a proxy class to toggle between V1 and V2.
@miccheng miccheng merged commit 8b25188 into CoderKungfu:master May 31, 2013
@gigablah gigablah deleted the aws-sdk-2 branch May 31, 2013 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants