Added the ability to download minidimps
This commit is contained in:
@@ -61,5 +61,5 @@ rrmdir(ReportParser::getWorkPath());
|
|||||||
|
|
||||||
if ($nr)
|
if ($nr)
|
||||||
{
|
{
|
||||||
IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new crash reports. http://crash.singularityviewer.org/crashes.php ");
|
IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new reports. http://crash.singularityviewer.org/crashes.php ");
|
||||||
}
|
}
|
||||||
17
htdocs/download.php
Normal file
17
htdocs/download.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
define("SITE_ROOT", realpath(dirname(__file__)));
|
||||||
|
require_once SITE_ROOT . "/lib/init.php";
|
||||||
|
$S->requireUser();
|
||||||
|
|
||||||
|
$r = ReportParser::parse((int)$_GET["report_id"]);
|
||||||
|
|
||||||
|
$miniDump = $r["Minidump"];
|
||||||
|
if (!$miniDump || !($miniDump->getData()))
|
||||||
|
{
|
||||||
|
Layout::header();
|
||||||
|
print "<h2>Minidump Download</h2><p>No such report</p>";
|
||||||
|
Layout::footer();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
http::sendDownload("singularity" . ((int)$_GET["report_id"]) . ".dmp", $miniDump->getData());
|
||||||
@@ -41,7 +41,7 @@ class ReportParser
|
|||||||
$q = kl_str_sql("select * from raw_reports where report_id=!i", $id);
|
$q = kl_str_sql("select * from raw_reports where report_id=!i", $id);
|
||||||
if (!$res = $DB->query($q) OR !$row = $DB->fetchRow($res))
|
if (!$res = $DB->query($q) OR !$row = $DB->fetchRow($res))
|
||||||
{
|
{
|
||||||
return new stdClass;
|
return array();
|
||||||
}
|
}
|
||||||
$data = new stdClass;
|
$data = new stdClass;
|
||||||
$DB->loadFromDbRow($data, $res, $row);
|
$DB->loadFromDbRow($data, $res, $row);
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ Layout::header();
|
|||||||
<th>Crash Reason</th>
|
<th>Crash Reason</th>
|
||||||
<td><?php echo htmlentities($report->crash_reason . " at " . $report->crash_address . " thread " . $report->crash_thread) ?></td>
|
<td><?php echo htmlentities($report->crash_reason . " at " . $report->crash_address . " thread " . $report->crash_thread) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Minidump</th>
|
||||||
|
<td><a href="download.php/singularity<?php echo (int)$report->id ?>.dmp?report_id=<?php echo (int)$report->id ?>">Download</a></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user