Merge pull request #1779 from smasty/fix-diagnose

Fix 'diagnose' command output and error
main
Jordi Boggiano 11 years ago
commit 3a8df46514

@ -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;
} }
} }

Loading…
Cancel
Save