From 66bb195233d4fa672d2e029c96032ddf17f5fcb3 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 3 Nov 2016 11:09:37 +0100 Subject: [PATCH] Add zlib warning to diagnose command --- src/Composer/Command/DiagnoseCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php index 44ccfa60b..551239376 100644 --- a/src/Composer/Command/DiagnoseCommand.php +++ b/src/Composer/Command/DiagnoseCommand.php @@ -494,6 +494,10 @@ EOT $warnings['apc_cli'] = true; } + if (!extension_loaded('zlib')) { + $warnings['zlib'] = true; + } + ob_start(); phpinfo(INFO_GENERAL); $phpinfo = ob_get_clean(); @@ -596,6 +600,12 @@ EOT $displayIniMessage = true; break; + case 'zlib': + $text = 'The zlib extension is not loaded, this can slow down Composer a lot.'.PHP_EOL; + $text .= 'If possible, enable it or recompile php with --with-zlib'.PHP_EOL; + $displayIniMessage = true; + break; + case 'sigchild': $text = "PHP was compiled with --enable-sigchild which can cause issues on some platforms.".PHP_EOL; $text .= "Recompile it without this flag if possible, see also:".PHP_EOL;