From 6a7264fc2dae6cd22abb10b82bd2b615e11a0031 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 8 Nov 2021 11:41:12 +0100 Subject: [PATCH] Trigger autoloading of a few classes before executing self-update command, fixes #10252 --- src/Composer/Command/SelfUpdateCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index c111580e7..cb8a6551d 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -79,6 +79,11 @@ EOT */ protected function execute(InputInterface $input, OutputInterface $output) { + // trigger autoloading of a few classes which may be needed when verifying/swapping the phar file + // to ensure we do not try to load them from the new phar, see https://github.com/composer/composer/issues/10252 + class_exists('Composer\Util\Platform'); + class_exists('Composer\Downloader\FilesystemException'); + $config = Factory::createConfig(); if ($config->get('disable-tls') === true) {