Beispiel #1
0
 * unexpectedly included in Input::all() or Input::get(). Leaving it
 * in the input array could cause unexpected results if the developer
 * fills an Eloquent model with the input.
 */
unset($input[Request::spoofer]);
Input::$input = $input;
//Compatibility hack
set_log4php_env('ls_log_file', \Config::get('env.log_path') . '/content.log');
\Logger::configure(\Config::get('log4php'));
/**
 * Route the request to the proper route in the application. If a
 * route is found, the route will be called with the current request
 * instance. If no route is found, the 404 response will be returned
 * to the browser.
 */
Routing\Filter::register(require APP_PATH . 'filters' . EXT);
$loader = new Routing\Loader(APP_PATH, ROUTE_PATH);
$router = new Routing\Router($loader, CONTROLLER_PATH);
IoC::instance('laravel.routing.router', $router);
Request::$route = $router->route(Request::method(), URI::current());
if (!is_null(Request::$route)) {
    $new_relic->name_transaction(Request::$route->key);
    try {
        $response = Request::$route->call();
    } catch (\Exception $e) {
        $handler($e);
    }
} else {
    $new_relic->name_transaction('404');
    \Laravel\Routing\Filter::run(array('before'), array(), true);
    $response = \Response::json(['msg' => 'Not found'], 404);
Beispiel #2
0
        break;
    }
}
// --------------------------------------------------------------
// Route the request and get the response from the route.
// --------------------------------------------------------------
if (is_null($response)) {
    $route = Routing\Router::make(Request::method(), Request::uri(), new Routing\Loader(ACTIVE_MODULE_PATH))->route();
    $response = is_null($route) ? Response::error('404') : $route->call();
}
$response = Response::prepare($response);
// --------------------------------------------------------------
// Call the "after" filter for the application and module.
// --------------------------------------------------------------
foreach (array(ACTIVE_MODULE . '::after', 'after') as $filter) {
    Routing\Filter::call($filter, array($response, Request::method(), Request::uri()));
}
// --------------------------------------------------------------
// Stringify the response.
// --------------------------------------------------------------
$response->content = (string) $response->content;
// --------------------------------------------------------------
// Close the session.
// --------------------------------------------------------------
if (Config::get('session.driver') != '') {
    Session::close();
}
// --------------------------------------------------------------
// Send the response to the browser.
// --------------------------------------------------------------
$response->send();