From 1e1a29c4a61573d07c70ea525722196869c5644d Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sun, 11 Apr 2021 16:46:30 +0100 Subject: [PATCH] Use APCu as level 2 optimisation https://getcomposer.org/doc/articles/autoloader-optimization.md --- composer.json | 1 + src/Step/Build/ComposerDumpAutoload.php | 2 +- src/Test/Unit/Step/Build/ComposerDumpAutoloadTest.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 6dc955cf60..eb870dd361 100755 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "require": { "php": "^7.1.3", "ext-PDO": "*", + "ext-apcu": "*", "ext-json": "*", "ext-sockets": "*", "colinmollenhour/credis": "^1.6.0", diff --git a/src/Step/Build/ComposerDumpAutoload.php b/src/Step/Build/ComposerDumpAutoload.php index 65a0c89fc6..84cedf0dea 100644 --- a/src/Step/Build/ComposerDumpAutoload.php +++ b/src/Step/Build/ComposerDumpAutoload.php @@ -61,7 +61,7 @@ public function execute() return; } - $this->shell->execute('composer dump-autoload -o --ansi --no-interaction'); + $this->shell->execute('composer dump-autoload --optimize --apcu --ansi --no-interaction'); } catch (ConfigException $e) { throw new StepException($e->getMessage(), $e->getCode(), $e); } catch (ShellException $e) { diff --git a/src/Test/Unit/Step/Build/ComposerDumpAutoloadTest.php b/src/Test/Unit/Step/Build/ComposerDumpAutoloadTest.php index 04fab70783..5fc9f2d988 100644 --- a/src/Test/Unit/Step/Build/ComposerDumpAutoloadTest.php +++ b/src/Test/Unit/Step/Build/ComposerDumpAutoloadTest.php @@ -70,7 +70,7 @@ public function testExecute(): void ->willReturn(false); $this->shellMock->expects($this->once()) ->method('execute') - ->with('composer dump-autoload -o --ansi --no-interaction'); + ->with('composer dump-autoload --optimize --apcu --ansi --no-interaction'); $this->step->execute(); } @@ -106,7 +106,7 @@ public function testExecuteWithException(): void $this->shellMock->expects($this->once()) ->method('execute') - ->with('composer dump-autoload -o --ansi --no-interaction') + ->with('composer dump-autoload --optimize --apcu --ansi --no-interaction') ->willThrowException(new ShellException('something went wrong')); $this->step->execute();