1
0
Fork 0

Merge pull request #1779 from smasty/fix-diagnose

Fix 'diagnose' command output and error
pull/1770/merge
Jordi Boggiano 2013-04-06 12:18:31 -07:00
commit 3a8df46514
1 changed files with 8 additions and 10 deletions

View File

@ -97,11 +97,11 @@ EOT
$output = '';
foreach ($messages as $style => $msgs) {
foreach ($msgs as $msg) {
$output .= '<' . $style . '>' . $msg . '</' . $style . '>';
$output .= '<' . $style . '>' . $msg . '</' . $style . '>' . PHP_EOL;
}
}
return $output;
return rtrim($output);
}
return true;
@ -210,7 +210,7 @@ EOT
$errors['php'] = PHP_VERSION;
}
if (version_compare(PHP_VERSION, '5.3.4', '<')) {
if (!isset($errors['php']) && version_compare(PHP_VERSION, '5.3.4', '<')) {
$warnings['php'] = PHP_VERSION;
}
@ -251,13 +251,10 @@ EOT
$displayIniMessage = true;
break;
}
if ($displayIniMessage) {
$text .= $iniMessage;
}
$out($text, 'error');
}
$out('');
$output .= PHP_EOL;
}
if (!empty($warnings)) {
@ -291,13 +288,14 @@ EOT
$text .= "Composer works with 5.3.2+ for most people, but there might be edge case issues.";
break;
}
if ($displayIniMessage) {
$text .= $iniMessage;
}
$out($text, 'warning');
}
}
if ($displayIniMessage) {
$out($iniMessage, 'warning');
}
return !$warnings && !$errors ? true : $output;
}
}