summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/crash_reporter.php10
-rwxr-xr-xusr/local/www/index.php2
2 files changed, 10 insertions, 2 deletions
diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php
index 924532c..a8d1345 100755
--- a/usr/local/www/crash_reporter.php
+++ b/usr/local/www/crash_reporter.php
@@ -88,6 +88,8 @@ $crash_report_header .= php_uname("r") . "\n";
$crash_report_header .= php_uname("v") . "\n";
$crash_report_header .= "\nCrash report details:\n";
+exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@@ -100,9 +102,9 @@ $crash_report_header .= "\nCrash report details:\n";
if (gettext($_POST['Submit']) == "Yes") {
echo gettext("Processing...");
file_put_contents("/var/crash/crashreport_header.txt", $crash_report_header);
- exec("/usr/bin/gzip /var/crash/*");
if(file_exists("/tmp/PHP_errors.log"))
exec("cp /tmp/PHP_errors.log /var/crash/");
+ exec("/usr/bin/gzip /var/crash/*");
$files_to_upload = glob("/var/crash/*");
echo "<p/>";
echo gettext("Uploading...");
@@ -111,6 +113,8 @@ $crash_report_header .= "\nCrash report details:\n";
if(is_array($files_to_upload)) {
$resp = upload_crash_report($files_to_upload);
exec("rm /var/crash/*");
+ // Erase the contents of the PHP error log
+ fclose(fopen("/tmp/PHP_errors.log", 'w'));
echo "<p/>";
print_r($resp);
echo "<p/><a href='/'>" . gettext("Continue") . "</a>" . gettext(" and delete crash report files from local disk.");
@@ -124,6 +128,10 @@ $crash_report_header .= "\nCrash report details:\n";
} else {
$crash_files = glob("/var/crash/*");
$crash_reports = $crash_report_header;
+ if (count($php_errors) > 0) {
+ $crash_reports .= "\nPHP Errors:\n";
+ $crash_reports .= implode("\n", $php_errors) . "\n\n";
+ }
if(is_array($crash_files)) {
foreach($crash_files as $cf) {
if(filesize($cf) < FILE_SIZE) {
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index a2d8733..a59a652 100755
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -60,7 +60,7 @@ if($g['disablecrashreporter'] != true) {
// Check to see if we have a crash report
$x = 0;
if(file_exists("/tmp/PHP_errors.log")) {
- $total = `/bin/cat /tmp/PHP_errors.log | /usr/bin/grep -vi warning | wc -l | awk '{ print $1 }'`;
+ $total = `/usr/bin/grep -vi warning /tmp/PHP_errors.log | /usr/bin/wc -l | /usr/bin/awk '{ print $1 }'`;
if($total > 0)
$x++;
}
OpenPOWER on IntegriCloud