瀏覽代碼

Report ICU failures as the intl extension being missing, refs #1939

Jordi Boggiano 12 年之前
父節點
當前提交
7449162aa4
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/Composer/DependencyResolver/Problem.php

+ 6 - 2
src/Composer/DependencyResolver/Problem.php

@@ -90,9 +90,13 @@ class Problem
 
                 // handle linked libs
                 if (0 === stripos($job['packageName'], 'lib-')) {
-                    $lib = substr($job['packageName'], 4);
+                    if (strtolower($job['packageName']) === 'lib-icu') {
+                        $error = extension_loaded('intl') ? 'has the wrong version installed, try upgrading the intl extension.' : 'is missing from your system, make sure the intl extension is loaded.';
 
-                    return "\n    - The requested linked library ".$job['packageName'].$this->constraintToText($job['constraint']).' has the wrong version installed or is missing from your system, make sure to have the extension providing it.';
+                        return "\n    - The requested linked library ".$job['packageName'].$this->constraintToText($job['constraint']).' '.$error;
+                    }
+
+                    return "\n    - The requested linked library ".$job['packageName'].$this->constraintToText($job['constraint']).' has the wrong version installed or is missing from your system, make sure to load the extension providing it.';
                 }
 
                 if (!preg_match('{^[A-Za-z0-9_./-]+$}', $job['packageName'])) {