Skip to content

Instantly share code, notes, and snippets.

@tufanbarisyildirim
Created September 15, 2011 14:22
Show Gist options
  • Save tufanbarisyildirim/1219362 to your computer and use it in GitHub Desktop.
Save tufanbarisyildirim/1219362 to your computer and use it in GitHub Desktop.
svn update
<?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