/** * Configuration of the limonade framework. Automatically called by run() */ function configure() { option('session', 'filez'); // specific session name option('views_dir', option('root_dir') . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR); // Layout settings error_layout('layout' . DIRECTORY_SEPARATOR . 'error.html.php'); layout('layout' . DIRECTORY_SEPARATOR . 'default.html.php'); require_once_dir(option('lib_dir')); // error handling set_error_handler('fz_php_error_handler', E_ALL ^ E_NOTICE); // Log every error set_exception_handler('fz_exception_handler'); // also handle uncatched excpeptions }
/** * Default not found error output * * @param string $errno * @param string $errstr * @param string $errfile * @param string $errline * @return string */ function not_found($errno, $errstr, $errfile = null, $errline = null) { option('views_dir', option('error_views_dir')); $msg = h(rawurldecode($errstr)); return html('<h1>' . __('Page not found') . " :</h1><p><code>{$msg}</code></p>", error_layout()); }
/** * Default server error output * * @param string $errno * @param string $errstr * @param string $errfile * @param string $errline * @return string */ function server_error($errno, $errstr, $errfile = null, $errline = null) { $is_http_error = http_response_status_is_valid($errno); $args = compact('errno', 'errstr', 'errfile', 'errline', 'is_http_error'); option('views_dir', option('limonade_views_dir')); $html = render('error.html.php', null, $args); option('views_dir', option('error_views_dir')); return html($html, error_layout(), $args); }
function server_error($errno, $errstr, $errfile = null, $errline = null) { $args = compact('errno', 'errstr', 'errfile', 'errline'); var_dump(error_layout()); var_dump($args); }