Exemplo n.º 1
0
        $item['args'] = $args;
        foreach ($trace as $frame) {
            if (isset($frame['file']) && is_file($frame['file'])) {
                $item['pathname'] = $frame['file'];
                $item['lineno'] = $frame['line'];
                break;
            }
        }
        $payload['logs'][] = NDebugHelpers::jsonDump($item, -1);
        foreach (str_split(base64_encode(@json_encode($payload)), 4990) as $k => $v) {
            header("FireLogger-de11e-{$k}:{$v}");
        }
        return TRUE;
    }
}
NDebug::_init();
final class NDebugHelpers
{
    static function renderBlueScreen(Exception $exception)
    {
        if (class_exists('NEnvironment', FALSE)) {
            $application = NEnvironment::getContext()->hasService('Nette\\Application\\Application', TRUE) ? NEnvironment::getContext()->getService('Nette\\Application\\Application') : NULL;
        }
        static $errorTypes = array(E_ERROR => 'Fatal Error', E_USER_ERROR => 'User Error', E_RECOVERABLE_ERROR => 'Recoverable Error', E_CORE_ERROR => 'Core Error', E_COMPILE_ERROR => 'Compile Error', E_PARSE => 'Parse Error', E_WARNING => 'Warning', E_CORE_WARNING => 'Core Warning', E_COMPILE_WARNING => 'Compile Warning', E_USER_WARNING => 'User Warning', E_NOTICE => 'Notice', E_USER_NOTICE => 'User Notice', E_STRICT => 'Strict', E_DEPRECATED => 'Deprecated', E_USER_DEPRECATED => 'User Deprecated');
        $title = $exception instanceof FatalErrorException && isset($errorTypes[$exception->getSeverity()]) ? $errorTypes[$exception->getSeverity()] : get_class($exception);
        $expandPath = NETTE_DIR . DIRECTORY_SEPARATOR;
        $counter = 0;
        if (headers_sent()) {
            echo '</pre></xmp></table>';
        }
        ?>