Created
September 15, 2011 14:22
-
-
Save tufanbarisyildirim/1219362 to your computer and use it in GitHub Desktop.
svn update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
$output = shell_exec('sudo svn up /srv/www/me.tufyta.com'); | |
$lines = explode("\n",$output); | |
$colors = array( | |
'A' => array('#640064','Addding'), | |
'D' => array('#640000','Deleting'), | |
'U' => array('#3a32a0','Modified') | |
); | |
echo '<pre>'; | |
foreach($lines as $line) | |
{ | |
list($firstChar) = explode(' ',$line); | |
list($color,$desc) = (isset($colors[$firstChar]) | |
? $colors[$firstChar] | |
: array('#000000','') | |
); | |
echo "<span style=\"color:{$color}\">{$desc}\t{$line}</span>\r\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment