/** * Redirect to 404. * * @param mix $action */ function not_found($action = null) { header('HTTP/1.1 404 Not Found'); header('status: 404 Not Found'); if ($action instanceof closure) { flush_action($action); exit; } $action = if_not_found(); if ($action instanceof closure) { flush_action($action, func_get_args()); exit; } }
<?php // init view path view_path(__DIR__ . '/../view/'); db_config(array('host' => '127.0.0.1', 'username' => 'root', 'password' => '', 'database' => 'passwd')); // init mongo config mongo_config(array('database' => 'test')); $GLOBALS['keys'] = "ADOCXLIE213WADACVTWE32`123"; // init 404 handler if_not_found(function ($msg = '') { return render('notfound'); }); $GLOBALS['redisConfig'] = array('scheme' => 'tcp', 'host' => '127.0.0.1', 'port' => 6379); $GLOBALS['redisCacheTime'] = 3600;