diff options
author | Eudyptula <eitan@mosenkis.net> | 2009-06-22 10:52:52 -0400 |
---|---|---|
committer | Eudyptula <eitan@mosenkis.net> | 2009-06-22 10:52:52 -0400 |
commit | 91e3bccf35c01c05f2062266ca1433ae46313bb5 (patch) | |
tree | 26bbe304f52c7255e0c8f43d20bb57cffe966c64 /frontend | |
parent | Added ACCEPT_KEYWORDS from Packages headers to make.conf (diff) | |
download | ingenue-91e3bccf35c01c05f2062266ca1433ae46313bb5.tar.gz ingenue-91e3bccf35c01c05f2062266ca1433ae46313bb5.tar.bz2 ingenue-91e3bccf35c01c05f2062266ca1433ae46313bb5.zip |
Little fixes to error handling and other minor things
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/functions/throw_exception.php | 5 | ||||
-rw-r--r-- | frontend/index.php | 2 | ||||
-rw-r--r-- | frontend/js/debug.js.php | 2 | ||||
-rw-r--r-- | frontend/pages/logview.php | 5 |
4 files changed, 9 insertions, 5 deletions
diff --git a/frontend/functions/throw_exception.php b/frontend/functions/throw_exception.php new file mode 100644 index 0000000..6a9c288 --- /dev/null +++ b/frontend/functions/throw_exception.php @@ -0,0 +1,5 @@ +<?php +function throw_exception($msg='') { + throw new Exception($msg); +} +?> diff --git a/frontend/index.php b/frontend/index.php index d17324a..30ced1c 100644 --- a/frontend/index.php +++ b/frontend/index.php @@ -40,7 +40,7 @@ for ($line=fgets($routing, 32768); !feof($routing); $line=fgets($routing, 32768) while ($dest != null) { debug('routing','Routing to '.$dest); if (!is_file('pages/'.$dest.'.php')) { - throw new Exception('Routing to '.$dest.' but pages/'.$dest.'.php doesn\'t exist.'); + throw_exception('Routing to '.$dest.' but pages/'.$dest.'.php doesn\'t exist.'); } require_once('pages/'.$dest.'.php'); $dest=str_replace(array('/', '-'), '_', $dest); diff --git a/frontend/js/debug.js.php b/frontend/js/debug.js.php index 9043235..5e33ce8 100644 --- a/frontend/js/debug.js.php +++ b/frontend/js/debug.js.php @@ -21,7 +21,7 @@ function debug (subtype, text) { div.className='debug '+(++debugrow%2?'odd':'even'); div.id='debug'+debugrow; big=text.match('<br') || text.length > 100; - div.innerHTML='<span class="type'+(big?' pointer" onclick="toggledebug('+debugrow+')':'')+'">'+(big?'<img id="debugmanager'+debugrow+'" src="'+url('images/minusbox.gif')+'" alt="[Hide]" /> ':'')+(subtype!=null?subtype+':':'')+(big?'</span>':'')+'<span> '+text+'</span>'; + div.innerHTML='<span class="type'+(big?' pointer" onclick="toggledebug('+debugrow+')':'')+'">'+(big?'<img id="debugmanager'+debugrow+'" src="'+url('images/minusbox.gif')+'" alt="[Hide]" /> ':'')+(subtype!=null?subtype+':':'')+'</span><span> '+text+'</span>'; document.getElementById("debugbox").appendChild(div); document.getElementById("debugcount").childNodes[0].nodeValue=debugrow; } diff --git a/frontend/pages/logview.php b/frontend/pages/logview.php index bb4900b..798bb85 100644 --- a/frontend/pages/logview.php +++ b/frontend/pages/logview.php @@ -30,7 +30,7 @@ function body_logview() { echo '<div style="font-family: monospace">'; while ($entry=$s->fetch(PDO::FETCH_ASSOC)) { $entry=new sql_buildlog_entry($entry); - $text=str_replace(array("\n", "\t"), array("<hr/>\n", str_repeat(' ', 4)), htmlentities($entry->text)); + $text=str_replace(array("\n", "\t"), array("<br/>\n", str_repeat(' ', 4)), htmlentities($entry->text)); echo '<a name="entry_'.$task->id.'_'.$entry->order.'"'.($entry->stream=='stderr'?' style="color: red" ':'').' title="'.strtoupper($entry->stream).', entry #'.$entry->order.' @ '.date('D j M Y @ H:i:s', $entry->timestamp).' UTC">'.$text.'</a>'; } echo '<a name="end"> </a>'; @@ -51,13 +51,12 @@ function body_logview() { echo '<a href="'.url('logs/task'.$task->id).'#end">Task #'.++$i.'</a>: '.htmlentities($task->command).'<br/>'; } } else { - $r=$S['pdo']->query('SELECT * FROM `builds` ORDER BY `id` ASC'); + $r=$S['pdo']->query('SELECT * FROM `builds` ORDER BY `ctime` ASC'); if ($r->rowCount() == 0) { echo print_warning('No builds found.'); } while ($build=$r->fetch(PDO::FETCH_ASSOC)) { $build=new sql_build($build); - debug('<pre>'.print_r($build, true).'</pre>'); echo '<a href="'.url('logs/build'.$build->id).'">Build '.$build->id.'</a>: '; if (isset($build->name)) { echo htmlentities($build->name); |