From 54a5ca5a3bec11ac1c89c890e2d5a0f31264228b Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 21 Apr 2022 15:01:28 +0200 Subject: [PATCH] Optimize autoloader level 2 This is using the APCu cache approache since because we load dynamically other apps that don't include a composer autoloader file the authoritative class maps approach is not possible. See https://getcomposer.org/doc/articles/autoloader-optimization.md#optimization-level-2-b-apcu-cache Signed-off-by: Carl Schwan --- build/autoloaderchecker.sh | 2 +- lib/composer/composer/autoload_real.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/autoloaderchecker.sh b/build/autoloaderchecker.sh index c0737eaeb6489..8e216b52c11ab 100755 --- a/build/autoloaderchecker.sh +++ b/build/autoloaderchecker.sh @@ -19,7 +19,7 @@ REPODIR=`git rev-parse --show-toplevel` #Redump the main autoloader echo echo "Regenerating main autoloader" -$COMPOSER_COMMAND dump-autoload -d $REPODIR +$COMPOSER_COMMAND dump-autoload --apcu -d $REPODIR for app in ${REPODIR}/apps/*; do if [[ -d $app ]]; then diff --git a/lib/composer/composer/autoload_real.php b/lib/composer/composer/autoload_real.php index eecff48bcf9f3..b61c18d4af05d 100644 --- a/lib/composer/composer/autoload_real.php +++ b/lib/composer/composer/autoload_real.php @@ -29,6 +29,7 @@ public static function getLoader() require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c::getInitializer($loader)); + $loader->setApcuPrefix('RWXoiKA0E8o6hrCf46Wc1'); $loader->register(true); return $loader;