From 50cbfda628e2cdcb8038120e3bcbf917d181178c Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 29 Apr 2014 00:21:14 +0200 Subject: [PATCH] Avoid some warnings when running batch jobs --- htdocs/batch_process.php | 161 ++++++++++++++++++++------------------- htdocs/lib/init.php | 2 +- 2 files changed, 82 insertions(+), 81 deletions(-) diff --git a/htdocs/batch_process.php b/htdocs/batch_process.php index f92d4f4..54dd1d5 100755 --- a/htdocs/batch_process.php +++ b/htdocs/batch_process.php @@ -1,80 +1,81 @@ -getData())) - { - ReportParser::deleteRaw($id); - continue; - } - - if (!($version = $r["clientVersion"])|| !($chan = $r["clientChannel"])) - { - ReportParser::deleteRaw($id); - continue; - } - - if (in_array($version, $blacklist)) - { - ReportParser::deleteRaw($id); - continue; - } - - $stacktrace = ReportParser::getStackTrace("$chan-$version", $r["Minidump"]); - $crash = new CrashReport(); - $crash->init($id, $r, $stacktrace); - if ($crash->save()) - { - $crash->updateSignature(); - $crash->saveSignature(); - $nr++; - ReportParser::setProcessed($id, 1); - } -} - -rrmdir(ReportParser::getWorkPath()); - -if ($nr) -{ - Memc::flush(); - $rp = $nr != 1 ? "reports" : "report"; - //IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new $rp. http://crash.singularityviewer.org/"); -} - -Session::GC(); +#!/usr/bin/php +getData())) + { + ReportParser::deleteRaw($id); + continue; + } + + if (!($version = $r["clientVersion"])|| !($chan = $r["clientChannel"])) + { + ReportParser::deleteRaw($id); + continue; + } + + if (in_array($version, $blacklist)) + { + ReportParser::deleteRaw($id); + continue; + } + + $stacktrace = ReportParser::getStackTrace("$chan-$version", $r["Minidump"]); + $crash = new CrashReport(); + $crash->init($id, $r, $stacktrace); + if ($crash->save()) + { + $crash->updateSignature(); + $crash->saveSignature(); + $nr++; + ReportParser::setProcessed($id, 1); + } +} + +rrmdir(ReportParser::getWorkPath()); + +if ($nr) +{ + Memc::flush(); + $rp = $nr != 1 ? "reports" : "report"; + //IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new $rp. http://crash.singularityviewer.org/"); +} + +Session::GC(); diff --git a/htdocs/lib/init.php b/htdocs/lib/init.php index 5cf6c37..c8e5fe1 100644 --- a/htdocs/lib/init.php +++ b/htdocs/lib/init.php @@ -71,8 +71,8 @@ if (!DBH::$db->connect($DB_NAME, $DB_HOST, $DB_USER, $DB_PASS)) { Option::init(); -$S = new Session(); if (!defined('NO_SESSION') && PHP_SAPI != "cli") { + $S = new Session(); $S->check(); }