]> git.pld-linux.org Git - projects/buildlogs.git/commitdiff
- added the gzip compression
authorwitekfl <witekfl@pld-linux.org>
Sat, 24 Nov 2007 11:10:45 +0000 (11:10 +0000)
committerwitekfl <witekfl@pld-linux.org>
Sat, 24 Nov 2007 11:10:45 +0000 (11:10 +0000)
- fixed some minor bugs
- added the configuration file buildlogs.inc

obsolete/buildlogs.sql/index.php

index e26235e149e2be5f6e0774f163e61158fc91c45d..2e00b8e110aa88c5d582543f866c80432f9bc7d5 100644 (file)
@@ -1,9 +1,9 @@
 <?php
-ob_start("ob_gzhandler");
+ob_start("ob_gzhandler", 1);
 $buildlogs_server = "buildlogs.pld-linux.org";
 $url = "index.php";
 $addr = array(
-       "",
+       "", /* must be first */
        "th/SRPMS",
        "th/i486",
        "th/i686",
@@ -37,6 +37,7 @@ $addr = array(
 );
 $fail_or_ok = array( "FAIL", "OK" );
 $qa_addr = array(
+       "", /* must be first */
        "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-SRPMS.txt",
        "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i486.txt",
        "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i686.txt",
@@ -72,6 +73,10 @@ $database = 'sqlite:/home/services/ftp/buildlogs.db';
 
 $local = 1; /* $local=0 for FTP */ 
 $root_directory = "/home/services/ftp/pub/pld-buildlogs";
+
+// $database and $root_directory are taken from buildlogs.inc
+include_once('buildlogs.inc');
+
 $ftp_conn = 0;
 /* It should be set */
 
@@ -124,9 +129,11 @@ else $ok="";
 if (isset($_GET["ns"]))$ns=(int)$_GET["ns"];
 else $ns="";
 if (isset($_GET["cnt"]))$cnt=(int)$_GET["cnt"];
+else $cnt = 50;
 if (isset($_GET["action"]))$action=$_GET["action"];
 else $action="";
 if (isset($_GET["off"]))$off=(int)$_GET["off"];
+else $off = 0;
 if (isset($_GET["id"]))$id=$_GET["id"];
 if (isset($_GET["log"]))$log=(int)$_GET["log"];
 
@@ -343,10 +350,10 @@ function list_logs()
        }
 */
        if ($ns != 1) $ns = 0;
-       if (!isset($idx)) $idx = 0;
+       if (!isset($idx)) $idx = 1;
        if (!isset($ok)) $ok = 0;
-       if (!isset($off)) $off = 0;
-       if (!isset($cnt)) $cnt = 50;
+//     if (!isset($off)) $off = 0;
+//     if (!isset($cnt)) $cnt = 50;
        if ($ns == 0) $order = "mtime DESC";
        else $order = "spec";
 
@@ -455,7 +462,7 @@ function list_logs()
 
 function file_name_log($l)
 {
-       global $database, $addr, $fail_or_ok;
+       global $database, $addr, $fail_or_ok, $idx, $ok;
        try {
                $dbh = new PDO($database);
        } catch (PDOException $e) {
@@ -464,6 +471,8 @@ function file_name_log($l)
        $f = false;
        foreach ($dbh->query("SELECT arch_id, result, spec FROM logs WHERE log_id = $l LIMIT 1") as $row) {
                $f = $addr[$row["arch_id"]] . "/" . $fail_or_ok[$row["result"]] . "/" . $row["spec"] . ".bz2";
+               $idx = $row["arch_id"]; /* for rpmqa */
+               $ok = $row["result"]; /* for status */
        }
        return $f;
 }
@@ -547,7 +556,7 @@ function dump_log($tail)
        if ($tail) {
                one_item(_("full text"), 
                         href(isset($log) ? "$url?log=$log" : "$bu&amp;id=$id",
-                             "View!"));
+                             _("View!")));
        }
 
        if ($qa_addr[$idx] != "") {
@@ -691,7 +700,7 @@ function list_archs()
                "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
             "<small>(c) 2002 ".
             "<a href=\"mailto:feedback@pld-linux.org\">PLD&nbsp;Team</a><br />\n".
-            '$Revision: 1.1 $'.
+            '$Revision: 1.2 $'.
             "</small></div>\n";
 
        # smile ;)
@@ -816,25 +825,32 @@ function adv_search()
        "e.checked = document.forms[0].all.checked;\n".
        "}\n }\n -->\n </script>\n";
 
+/* Shut up warnings */
+  if (!isset($_POST["name"])) $_POST["name"] = "";
+  if (!isset($_POST["age1"])) $_POST["age1"] = "";
+  if (!isset($_POST["age2"])) $_POST["age2"] = "";
+  if (!isset($_POST["size1"])) $_POST["size1"] = "";
+  if (!isset($_POST["size2"])) $_POST["size2"] = "";
+
   echo "<form action=\"index.php?action=adv_search\" method=\"post\">";
 
   echo "<div align=\"center\">";
   echo "<table border=\"0\">\n";
   echo "<tr>\n";
   echo "<td>"._("Package name")."</td>\n";
-  echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST["name"]."\"/></td>\n";
+  echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"". $_POST["name"] ."\"/></td>\n";
   echo "</tr>\n";
 
   echo "<tr>\n";
   echo "<td>"._("Days")."</td>\n";
-  echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"age1\" value=\"".$_POST["age1"]."\" /></td>\n";
-  echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"age2\" value=\"".$_POST["age2"]."\" /></td>\n";
+  echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"age1\" value=\"". $_POST["age1"] ."\" /></td>\n";
+  echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"age2\" value=\"". $_POST["age2"] ."\" /></td>\n";
   echo "</tr>\n";
 
   echo "<tr>\n";
   echo "<td>"._("Size")."</td>\n";
-  echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"size1\" value=\"".$_POST["size1"]."\" /></td>\n";
-  echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"size2\" value=\"".$_POST["size2"]."\" /></td>\n";
+  echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"size1\" value=\"". $_POST["size1"] ."\" /></td>\n";
+  echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"size2\" value=\"". $_POST["size2"] ."\" /></td>\n";
   echo "</tr>\n";
 
   echo "<tr>\n";
@@ -914,8 +930,8 @@ function adv_search()
                }
        }
        if ($or == " OR ") $query .= ")";
-       if (!isset($cnt)) $cnt = 50;
-       if (!isset($off)) $off = 0;
+//     if (!isset($cnt)) $cnt = 50;
+//     if (!isset($off)) $off = 0;
        if (!isset($ns)) $ns = 0;
        switch ($ns) {
                case 0:
@@ -951,8 +967,8 @@ function adv_search()
                         "[<a href=\"$big_url&amp;ns=0\">"._("sort")."</a>]</th>".
                         "</th></tr>";
                $i = $off;
-               foreach ($result as $row) {
 //             for ($i = $off; $i < $off + $count; $i++) {
+               foreach ($result as $row) {
                        $f = $row["spec"];
                        $t = $now - $row["mtime"];
                        $s = $row["size"];
@@ -1046,7 +1062,7 @@ function welcome()
 <!-- ech... niech strace... -->
 <a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?> 
 <a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
-<p>Version: $Id: index.php,v 1.1 2006-10-03 18:32:27 witekfl Exp $</p>
+<p>Version: $Id: index.php,v 1.2 2007-11-18 10:00:17 witekfl Exp $</p>
 </td><td width="20%">&nbsp;</td></tr>
 </table>
 <?php
This page took 0.036251 seconds and 4 git commands to generate.