Exemplo n.º 1
0
                        while (!feof($f)) {
                            $buffer = fread($f, 4096);
                            echo '<pre>' . str_replace(array('ERROR -', 'INFO -', 'DEBUG -'), array('</pre><pre class="alert alert-warning"><img alt="error" src="' . self::$assets['error_icon'] . '" />', '</pre><pre class="info"><img alt="info" src="' . self::$assets['info_icon'] . '" />', '</pre><pre class="debug"><img alt="debug" src="' . self::$assets['debug_icon'] . '" />'), $buffer) . '</pre>';
                            flush();
                        }
                        $lastpos = ftell($f);
                        fclose($f);
                    }
                }
            } else {
                echo 'No today log found';
            }
        }
    }
}
if (!Viewer::checkAccess()) {
    die('Your IP (' . $_SERVER['REMOTE_ADDR'] . ') is not allowed');
}
if (isset($_GET['q'])) {
    $query = $_GET['q'];
    switch ($query) {
        case 'phpinfo':
            echo '<style>body{margin: 60px 20px 20px 20px;}</style>';
            phpinfo();
            Viewer::stopProgress();
            die;
            break;
        case 'file':
            if (isset($_GET['f'])) {
                Viewer::readLog($_GET['f']);
            }