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) {