Report parser complete
This commit is contained in:
58
htdocs/batch_process.php
Normal file
58
htdocs/batch_process.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
define("SITE_ROOT", realpath(dirname(__file__)));
|
||||
require_once SITE_ROOT . "/lib/init.php";
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
if (PHP_SAPI != "cli")
|
||||
{
|
||||
header("Content-Type: text/plain");
|
||||
}
|
||||
|
||||
function rrmdir($dir)
|
||||
{
|
||||
foreach(glob($dir . '/*') as $file)
|
||||
{
|
||||
if(is_dir($file))
|
||||
rrmdir($file);
|
||||
else
|
||||
unlink($file);
|
||||
}
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
$reports = ReportParser::getUnprocessedIDs();
|
||||
|
||||
print "Working dir set to " . ReportParser::getWorkPath() . "\n";
|
||||
mkdir(ReportParser::getWorkPath());
|
||||
chdir(ReportParser::getWorkPath());
|
||||
|
||||
foreach($reports as $id)
|
||||
{
|
||||
print "Processing report {$id} \n";
|
||||
$r = ReportParser::parse($id);
|
||||
$miniDump = $r["Minidump"];
|
||||
if (!$miniDump || !($miniDump->getData()))
|
||||
{
|
||||
ReportParser::setProcessed($id, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!($version = $r["clientVersion"])|| !($chan = $r["clientChannel"]))
|
||||
{
|
||||
ReportParser::setProcessed($id, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
$stacktrace = ReportParser::getStackTrace("$chan-$version", $r["Minidump"]);
|
||||
$crash = new CrashReport();
|
||||
$crash->init($id, $r, $stacktrace);
|
||||
if ($crash->save())
|
||||
{
|
||||
ReportParser::setProcessed($id, 1);
|
||||
}
|
||||
}
|
||||
|
||||
rrmdir(ReportParser::getWorkPath());
|
||||
|
||||
Reference in New Issue
Block a user