summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-09-09 22:01:39 +0000
committerRomain d'Alverny <rda@mageia.org>2012-09-09 22:01:39 +0000
commitc18473f9b74747b692bf356888811c69841602ad (patch)
tree65e01297c5001101ba3c5cc42e39702ed267be22
parent1e02e816c6ff4ea9f655511652ce76ff5b64f49c (diff)
downloadpkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar.gz
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar.bz2
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar.xz
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.zip
fix warnings (undeclared/unset vars)
-rw-r--r--lib.php29
-rw-r--r--test_index.php2
2 files changed, 19 insertions, 12 deletions
diff --git a/lib.php b/lib.php
index dc5b378..5f4f559 100644
--- a/lib.php
+++ b/lib.php
@@ -67,17 +67,20 @@ function get_refined_packages_list($list_of_files, $package = null, $user = null
continue;
}
$key = $val[6] . $val[7];
- if (!is_array($pkgs[$key])) {
+ if (!array_key_exists($key, $pkgs)) {
$pkgs[$key] = array(
- 'status' => array(),
- 'path' => $val[2],
- 'version' => $val[3],
- 'media' => $val[4],
- 'section' => $val[5],
- 'user' => $val[7],
- 'host' => $val[8],
- 'job' => $val[9]
+ 'status' => array(),
+ 'path' => $val[2],
+ 'version' => $val[3],
+ 'media' => $val[4],
+ 'section' => $val[5],
+ 'user' => $val[7],
+ 'host' => $val[8],
+ 'job' => $val[9],
+ 'revision' => '',
+ 'summary' => '',
+ 'package' => ''
);
}
$status = $val[1];
@@ -217,7 +220,7 @@ function key2timestamp($key) {
*
* @return string
*/
-function timediff($start, $end)
+function timediff($start, $end = null)
{
if (is_null($end)) {
$end = time();
@@ -467,7 +470,11 @@ S;
} else {
$d = explode(' ', $duration);
if ($d[0] > 20) {
- $newdata['21 minutes'] += $count;
+ if (!array_key_exists('21 minutes', $newdata)) {
+ $newdata['21 minutes'] = $count;
+ } else {
+ $newdata['21 minutes'] += $count;
+ }
} else {
$newdata[$duration] = $count;
}
diff --git a/test_index.php b/test_index.php
index c54f468..cfe9fdf 100644
--- a/test_index.php
+++ b/test_index.php
@@ -229,7 +229,7 @@ if ($total > 0) {
}
}
$typestr = $p['type'];
- if ($p['status']['build']) {
+ if (isset($p['status']['build'])) {
$typealt = 'Building on';
foreach ($p['status']['build'] as $h) {
$typealt .= " $h";