summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'shared/classes/build.php')
-rw-r--r--shared/classes/build.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/shared/classes/build.php b/shared/classes/build.php
index db12801..7230673 100644
--- a/shared/classes/build.php
+++ b/shared/classes/build.php
@@ -60,8 +60,8 @@ class sql_build extends conf_build_common {
$html='<div class="build"><span class="name">'.(isset($this->name) && strlen($this->name)?htmlentities($this->name):'Unnamed Build').'</span> ';
$links=array();
if ($this->status == -128) {
- $total=$S['pdo']->query('SELECT COUNT(*) FROM `builds` WHERE `status`=-128')->fetch(PDO::FETCH_COLUMN);
- $num=$S['pdo']->query('SELECT COUNT(*) FROM `builds` WHERE `status`=-128 AND `ctime` <= '.$this->ctime)->fetch(PDO::FETCH_COLUMN);
+ $total=query('SELECT COUNT(*) FROM `builds` WHERE `status`=-128')->fetch(PDO::FETCH_COLUMN);
+ $num=query('SELECT COUNT(*) FROM `builds` WHERE `status`=-128 AND `ctime` <= '.$this->ctime)->fetch(PDO::FETCH_COLUMN);
$html.="<span class=\"status queued\">[Queued ($num/$total)]</span>";
} elseif ($this->status == -127) {
$html.='<span class="status successful">[uploading]</span>';
@@ -74,7 +74,7 @@ class sql_build extends conf_build_common {
$links['Build Log']="build/$this->id";
}
} elseif ($this->status == 0) {
- $r=$S['pdo']->query('SELECT COUNT(*) as `count`, MAX(`time`) as `time` FROM `downloads` WHERE `build`="'.$this->id.'"')->fetch(PDO::FETCH_ASSOC);
+ $r=query('SELECT COUNT(*) as `count`, MAX(`time`) as `time` FROM `downloads` WHERE `build`="'.$this->id.'"')->fetch(PDO::FETCH_ASSOC);
$d=($perms && $r['count']?'<a href="'.url("build/$this->id/history").'">':'').$r['count'].' download'.($r['count'] != 1?'s':'').($r['count']?($perms?'</a>':'').'<br/><span class="time">(last at '.date($format, $r['time']).')</span>':'');
$html.='<span class="downloads">'.$d.'</span><span class="status successful">[successful]</span>';
$links['Download image']="build/$this->id/download";
@@ -125,15 +125,15 @@ class sql_build extends conf_build_common {
global $S;
static $cache;
if (!isset($cache))
- $cache=$S['pdo']->query('SELECT COUNT(`order`) FROM `tasks` WHERE `start` IS NULL AND `build`="'.$this->id.'"')->fetch(PDO::FETCH_COLUMN);
+ $cache=query('SELECT COUNT(`order`) FROM `tasks` WHERE `start` IS NULL AND `build`="'.$this->id.'"')->fetch(PDO::FETCH_COLUMN);
return $cache;
}
public function delete() {
global $S;
- $S['pdo']->query('DELETE FROM `buildlogs` WHERE `build`="'.$this->id.'"');
- $S['pdo']->query('DELETE FROM `tasks` WHERE `build`="'.$this->id.'"');
- $S['pdo']->query('DELETE FROM `buildopts` WHERE `build`="'.$this->id.'"');
- $S['pdo']->query('DELETE FROM `downloads` WHERE `build`="'.$this->id.'"');
+ query('DELETE FROM `buildlogs` WHERE `build`="'.$this->id.'"');
+ query('DELETE FROM `tasks` WHERE `build`="'.$this->id.'"');
+ query('DELETE FROM `buildopts` WHERE `build`="'.$this->id.'"');
+ query('DELETE FROM `downloads` WHERE `build`="'.$this->id.'"');
foreach (glob(COMPLETED."/build-.$this->id.*") as $file)
unlink($file);
parent::delete();