user101289
user101289

Reputation: 10422

AWS PHP sdk -- selected services

I would like to use some parts of the AWS PHP SDK (https://github.com/aws/aws-sdk-php). However, the whole set is pretty heavy-- lots of files and functionality I don't need. I really only need to work with S3 objects, I don't need the EC2, DynamoDB etc. stuff.

Is it possible to selectively build this SDK to eliminate the unnecessary stuff? Or can I simply remove the elements I don't need?

Thanks for any ideas.

Upvotes: 1

Views: 177

Answers (2)

Jeremy Lindblom
Jeremy Lindblom

Reputation: 6527

While I agree with Ryan, here is some other information that might be helpful to your specific use case.

The SDK is now additionally shipped as a zip archive (starting with version 2.3.2), which also includes its third-party dependencies in a PSR-0 compatible directory structure. You could technically just pull out what you need from there.

If you just want S3, you only need the Aws\Common and Aws\S3 namespaces from the SDK source. However, you'll also need all of Guzzle and the Symfony Event Dispatcher. You could safely remove the Doctrine, Monolog, and Psr components though since they are optional.

Upvotes: 3

Ryan Parman
Ryan Parman

Reputation: 6945

Well, an SDK is precisely that… a Software Development Kit.

I suppose the first logical question is: why?

Now that many (most?) projects are using tools like Composer to manage project dependencies, how much does it really matter?

That said, no, there's not an easy way to do it. You can theoretically delete some stuff, but if something goes wrong, you'll need to reproduce the issue with the full SDK.

Upvotes: 1

Related Questions