Skip to content

Instantly share code, notes, and snippets.

Created February 12, 2014 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8955328 to your computer and use it in GitHub Desktop.
Save anonymous/8955328 to your computer and use it in GitHub Desktop.
<?php
$i = 0;
$lastActiveTime = microtime(true);
$errorBreakLine = str_repeat("*", exec("tput cols"));
while(!feof(STDIN)){
$line = fgets(STDIN);
$nowTime = microtime(true);
if(($nowTime - $lastActiveTime) > 1)
{
echo "\e[1;36m".date("g:i:s a --- F j, Y").PHP_EOL;
echo "\e[1;36m".$errorBreakLine.PHP_EOL;
$lastActiveTime = $nowTime;
}
if (strpos($line, '**CSDEV**'))
{
echo "\e[1;31m".$line;
}
elseif(strpos($line, '**CSDEV**'))
{
echo "\e[1;36m".$line;
}
else
{
if ($i % 2 == 0)
echo "\e[1;32m".$line;
else
echo "\e[1;34m".$line;
$i++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment