From 1716a346e6dde013bc7eeb8bd5b46c1ad303ab1a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 17 Feb 2016 15:42:58 +0000 Subject: [PATCH] Add mbstring/iconv check, fixes #4929 --- src/Composer/Command/DiagnoseCommand.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php index 2b1927f6b..87ba2cc0e 100644 --- a/src/Composer/Command/DiagnoseCommand.php +++ b/src/Composer/Command/DiagnoseCommand.php @@ -433,6 +433,10 @@ EOT $errors['hash'] = true; } + if (!extension_loaded('iconv') && !extension_loaded('mbstring')) { + $errors['iconv_mbstring'] = true; + } + if (!ini_get('allow_url_fopen')) { $errors['allow_url_fopen'] = true; } @@ -505,6 +509,11 @@ EOT $text .= "Install it or recompile php without --disable-hash"; break; + case 'iconv_mbstring': + $text = PHP_EOL."The iconv OR mbstring extension is required and both are missing.".PHP_EOL; + $text .= "Install either of them or recompile php without --disable-iconv"; + break; + case 'unicode': $text = PHP_EOL."The detect_unicode setting must be disabled.".PHP_EOL; $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;