From 3f63bc92058f17859f0c07cd182731bf1343cc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Wed, 4 Nov 2020 12:00:12 +0100 Subject: [PATCH] AutoloadGenerator: Trigger native PHP error on platform checks fails --- src/Composer/Autoload/AutoloadGenerator.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index dcbdc93e8..10bf27167 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -734,10 +734,11 @@ EXT_CHECKS; \$issues = array(); ${requiredPhp}${requiredExtensions} -if (\$issues && !headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - echo 'Composer detected issues in your platform:' . "\\n\\n" . implode("\\n", \$issues) . "\\n\\n"; - exit(104); +if (\$issues) { + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', \$issues), + E_USER_ERROR + ); } PLATFORM_CHECK;