SVN: toys/stbr: index.php queue.php
vip
vip at pld-linux.org
Sun Nov 23 15:00:17 CET 2008
Author: vip
Date: Sun Nov 23 15:00:16 2008
New Revision: 10002
Modified:
toys/stbr/index.php
toys/stbr/queue.php
Log:
- kill shadzik
- allow multiple instances of Query with different line queue files
Modified: toys/stbr/index.php
==============================================================================
--- toys/stbr/index.php (original)
+++ toys/stbr/index.php Sun Nov 23 15:00:16 2008
@@ -1,11 +1,18 @@
<?
ob_start("ob_gzhandler");
-$db = sqlite_open("../db/stbrlog.db");
+$db = sqlite_open("stbrlog.db");
include("queue.php");
-$queue = new Queue();
+$distros = array(
+ "th" => "http://ep09.pld-linux.org/~builderth/queue.gz",
+ "ti" => "http://ep09.pld-linux.org/~builderti/queue.gz"
+);
+foreach($distros as $line => $url)
+{
+ $queue[$line] = new Queue($url);
+}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
@@ -342,7 +349,7 @@
if(empty($q['queue_requester']) && empty($q['queue_date']))
{
- $filled = $queue->is_filled(array('spec' => $q['aspec'], 'date' => $p['date'], 'builder' => $q['builder'], 'line' => $q['line']));
+ $filled = $queue[$q['line']]->is_filled(array('spec' => $q['aspec'], 'date' => $p['date'], 'builder' => $q['builder'], 'line' => $q['line']));
if(count($filled))
{
Modified: toys/stbr/queue.php
==============================================================================
--- toys/stbr/queue.php (original)
+++ toys/stbr/queue.php Sun Nov 23 15:00:16 2008
@@ -5,9 +5,14 @@
class Queue
{
//var $xmlqueuepath = "queue.gz";
- //var $xmlqueuepath = "http://ep09.pld-linux.org/~builderth/queue.gz";
+ var $xmlqueuepath = '';
var $queue = '';
+ public function __construct($xmlqueuepath)
+ {
+ $this->xmlqueuepath = $xmlqueuepath;
+ }
+
function array_preg_search($data, $search)
{
foreach($data as $key => $value)
@@ -81,14 +86,11 @@
return $result;
}
- function prepare_queue_data($dist)
+ function prepare_queue_data()
{
- $xmlqueuepath = "http://ep09.pld-linux.org/~builder" .$dist. "/queue.gz";
- //$xmlqueuepath = "http://ep09.pld-linux.org/~builderth/queue.gz";
if(empty($this->queue))
{
- //$this->queue = $this->gzfile_get_contents($this->xmlqueuepath);
- $this->queue = $this->gzfile_get_contents($xmlqueuepath);
+ $this->queue = $this->gzfile_get_contents($this->xmlqueuepath);
$this->queue = simplexml_load_string($this->queue);
}
}
@@ -96,8 +98,7 @@
function is_filled($spec)
{
$status = array();
- $this->prepare_queue_data($spec['line']);
- //$this->prepare_queue_data();
+ $this->prepare_queue_data();
$spec['date'] = strtotime($spec['date']);
$status = $this->queue_search_recursive($spec);
More information about the pld-cvs-commit
mailing list