query('SELECT * FROM `tasks` WHERE `build`=\''.$request['build'].'\' AND `order`='.$request['task']);
if ($r->rowCount() == 0) {
echo print_error('Not found', 'Build '.$request['build'].'/task '.$request['task'].' was not found.');
return;
}
$task=new sql_task($r->fetch(PDO::FETCH_ASSOC));
echo '
';
$ansi=new ansi_to_html();
while ($entry=$r->fetch(PDO::FETCH_ASSOC)) {
$entry=new sql_buildlog_entry($entry);
// $text=str_replace(array("\n", "\t"), array("
\n", str_repeat(' ', 4)), htmlentities($entry->text));
// echo '
stream=='stderr'?' style="color: red" ':'').' title="'.strtoupper($entry->stream).', entry #'.$entry->order.' @ '.date('D j M Y @ H:i:s', $entry->timestamp).' UTC">'.$text.'';
echo $ansi->process(str_replace(array("\n", ' ', "\t"), array("
\n", ' ', str_repeat(' ', 8)), $entry->text));
// TODO handle tabs properly, move all this into ansi_to_html
}
echo $ansi->reset(); // Clear any leftover
s
echo ' ';
echo $pager;
echo '