From baa0a63d2afedf05d07eb8fbc5d6f361ddd05033 Mon Sep 17 00:00:00 2001 From: aydreeihn Date: Thu, 3 Nov 2022 11:07:14 -0500 Subject: [PATCH] Issue: Decrease S3 Plugin Size This commit reduces the size of the S3 plugin by only pulling services related to S3 from the AWS SDK. This is done by following the steps outlined here: https://github.com/stobrien89/aws-sdk-php/tree/remove-unused-services/src/Script/Composer --- storage-s3/plugin.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/storage-s3/plugin.php b/storage-s3/plugin.php index 4a99fc42..13ad3101 100644 --- a/storage-s3/plugin.php +++ b/storage-s3/plugin.php @@ -12,8 +12,7 @@ "aws/aws-sdk-php" => array( 'version' => "3.*", 'map' => array( - 'aws/aws-sdk-php/src/{Api*,Arn*,ClientSideMonitoring*,Credentials*,DefaultsMode*,Endpoint*,Exception*,Handler*,Retry*,S3*,Signature*,*.php}' => 'lib/Aws', - 'aws/aws-sdk-php/src/data' => 'lib/Aws', + 'aws/aws-sdk-php/src' => 'lib/Aws', 'guzzlehttp/guzzle/src' => 'lib/GuzzleHttp', 'guzzlehttp/promises/src' => 'lib/GuzzleHttp/Promise', 'guzzlehttp/psr7/src/' => 'lib/GuzzleHttp/Psr7', @@ -24,6 +23,12 @@ ), ), ), + 'scripts' => array( + 'pre-autoload-dump' => 'Aws\\Script\\Composer\\Composer::removeUnusedServices', + ), + 'extra' => array( + 'aws/aws-sdk-php' => 'S3', + ), 'plugin' => 'storage.php:S3StoragePlugin' );