From 1290d9037b50c7bb8c9009065640e4a3078dc441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 7 Nov 2019 17:30:06 +0100 Subject: [PATCH] Mark s3 client service definition as lazy Instantiating a client has a big memory cost, because it loads a big JSON file (https://github.com/aws/aws-sdk-php/blob/master/src/data/s3/2006-03-01/api-2.json) Closes #59 --- src/DependencyInjection/AwsExtension.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DependencyInjection/AwsExtension.php b/src/DependencyInjection/AwsExtension.php index 1adc34f..42f32d3 100644 --- a/src/DependencyInjection/AwsExtension.php +++ b/src/DependencyInjection/AwsExtension.php @@ -60,6 +60,7 @@ class_exists($clientClass) ? $clientClass : AwsClient::class } return $serviceDefinition + ->setLazy(true) ->setFactoryService('aws_sdk') ->setFactoryMethod('create' . $name); }