From 8657f80ddd02c9b5a3f8a3db8ff42aabc251e485 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 13 Sep 2021 21:46:28 +0200 Subject: [PATCH] Fix error output to be clearer when running composer.phar without phar extension, fixes #10097 --- src/Composer/Compiler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index a0f303f9f..8476a529f 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -302,6 +302,11 @@ if (extension_loaded('apc') && filter_var(ini_get('apc.enable_cli'), FILTER_VALI } } +if (!class_exists('Phar')) { + echo 'PHP\'s phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again.' . PHP_EOL; + exit(1); +} + Phar::mapPhar('composer.phar'); EOF;