Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a simple way to reduce the AWS PHP SDK to use only S3?

I would like to know is there a simple way to reduce the AWS PHP SDK to use only S3 ? I tried to delete certain directory but there are so many it will take an incredible time, and I have many errors depending on the files I delete (21,6Mo - 2 368 elements) ?! Is it possible to know the architecture of the basic files necessary to use only S3 with the SDK PHP please?

I found old posts on this subject but the file structure has changed and they are no longer current.

The complete SDK is very heavy with a lot of files that I don't need to keep my sources with an optimization in reasonable size.

Thanks for your help

like image 730
Nicolas Avatar asked Oct 22 '25 19:10

Nicolas


1 Answers

The SDK itself now has a (beta) feature to help you out. Check out https://github.com/aws/aws-sdk-php/tree/master/src/Script/Composer

Basically you require the framework with composer, then specify a script to remove unused services, then define the services you want to keep based on their root namespace.

The example from the page is given below

{
    "require": {
        "aws/aws-sdk-php": "<version here>"
    },
    "scripts": {
        "pre-autoload-dump": "Aws\\Script\\Composer\\Composer::removeUnusedServices"
    },
    "extra": {
        "aws/aws-sdk-php": [
            "Ec2",
            "CloudWatch"
        ]
    }
}
like image 195
Mark Avatar answered Oct 25 '25 07:10

Mark