Browse Source

Add mbstring/iconv check, fixes #4929

Jordi Boggiano 9 years ago
parent
commit
1716a346e6
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/Composer/Command/DiagnoseCommand.php

+ 9 - 0
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;