ENHANCEMENT: Improved layout of altercation message when called via CLI. Patch via simon_w #4373 (from r94515)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95618 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-12-16 05:42:21 +00:00
parent f663e4f949
commit d1e5f7dc91

View File

@ -614,7 +614,26 @@ abstract class SS_Database {
*/
function alterationMessage($message,$type=""){
if(!$this->supressOutput) {
$color = "";
if(Director::is_cli()) {
switch ($type){
case "created":
case "changed":
case "repaired":
$sign = "+";
break;
case "obsolete":
case "deleted":
$sign = '-';
break;
case "error":
$sign = "!";
break;
default:
$sign=" ";
}
$message = strip_tags($message);
echo " $sign $message\n";
} else {
switch ($type){
case "created":
$color = "green";
@ -637,7 +656,8 @@ abstract class SS_Database {
default:
$color="";
}
echo (Director::is_cli()) ? " * ".strip_tags($message)."\n" : "<li style=\"color: $color\">$message</li>";
echo "<li style=\"color: $color\">$message</li>";
}
}
}