Exemplo n.º 1
0
        @rename('/tmp/PHP_errors.log', '/var/crash/PHP_errors.log');
        @copy('/var/run/dmesg.boot', '/var/crash/dmesg.boot');
        exec('/usr/bin/gzip /var/crash/*');
        $files_to_upload = glob('/var/crash/*');
        $resp = upload_crash_report($files_to_upload, $user_agent);
        array_map('unlink', $files_to_upload);
    } elseif ($_POST['Submit'] == 'no') {
        array_map('unlink', glob('/var/crash/*'));
        @unlink('/tmp/PHP_errors.log');
    } elseif ($_POST['Submit'] == 'new') {
        /* force a crash report generation */
        $has_crashed = true;
    }
} else {
    /* if there is no user activity probe for a crash report */
    $has_crashed = get_crash_report(true) != '';
}
if ($has_crashed) {
    $crash_files = glob("/var/crash/*");
    $crash_reports['System Information'] = trim($crash_report_header);
    $php_errors = @file_get_contents('/tmp/PHP_errors.log');
    if (!empty($php_errors)) {
        $crash_reports['PHP Errors'] = trim($php_errors);
    }
    $dmesg_boot = @file_get_contents('/var/run/dmesg.boot');
    if (!empty($dmesg_boot)) {
        $crash_reports['dmesg.boot'] = trim($dmesg_boot);
    }
    foreach ($crash_files as $cf) {
        if (!is_link($cf) && $cf != '/var/crash/minfree' && $cf != '/var/crash/bounds' && filesize($cf) < 450000) {
            $crash_reports[$cf] = trim(file_get_contents($cf));
Exemplo n.º 2
0
			</div>
		</div>
	</section>
	<meta http-equiv="refresh" content="3;url=wizard.php">
	<?php 
    exit;
}
?>

<section class="page-content-main">
	<div class="container-fluid">

        <div class="row">

				<?php 
$crash_report = get_crash_report();
if ($crash_report != '') {
    print_info_box($crash_report);
}
$totalwidgets = count($widgetfiles);
$halftotal = $totalwidgets / 2 - 2;
$widgetcounter = 0;
$directory = "/usr/local/www/widgets/widgets/";
$printed = false;
$firstprint = false;
foreach ($widgetlist as $widget) {
    if (!stristr($widget, "widget.php")) {
        continue;
    }
    $periodpos = strpos($widget, ".");
    $widgetname = substr($widget, 0, $periodpos);
Exemplo n.º 3
0
    }
    file_put_contents('/var/crash/crashreport_header.txt', $crash_report_header);
    @rename('/tmp/PHP_errors.log', '/var/crash/PHP_errors.log');
    exec('/usr/bin/gzip /var/crash/*');
    $files_to_upload = glob('/var/crash/*');
    echo '<br/>' . gettext('Uploading...');
    ob_flush();
    flush();
    $resp = upload_crash_report($files_to_upload);
    echo '<br/>' . print_r($resp) . '</p>';
    array_map('unlink', $files_to_upload);
} elseif ($_POST['Submit'] == 'no') {
    array_map('unlink', glob('/var/crash/*'));
    @unlink('/tmp/PHP_errors.log');
}
if (get_crash_report(true) == '') {
    echo '<p><strong>';
    if ($_POST['Submit'] == 'yes') {
        echo gettext('Thank you for submitting this crash report.');
    } elseif ($_POST['Submit'] == 'no') {
        echo gettext('Please consider submitting a crash report if the error persists.');
    } else {
        echo gettext('Luckily we have not detected a programming bug.');
    }
    echo '</strong></p>';
} else {
    $crash_files = glob("/var/crash/*");
    $crash_reports = $crash_report_header;
    $php_errors = @file_get_contents('/tmp/PHP_errors.log');
    if (!empty($php_errors)) {
        $crash_reports .= "\nPHP Errors:\n";