1
0
Fork 0

Fix diagnose command output

pull/1779/head
Smasty 2013-04-06 13:00:08 +02:00
parent b519d65bff
commit a1def50ae4
1 changed files with 8 additions and 10 deletions

View File

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