$value = new Response($value);
}
return $value->prepare($request);
}
protected function handleRoutingException(\Exception $e)
{
if ($e instanceof ResourceNotFoundException) {
throw new NotFoundHttpException($e->getMessage());
} elseif ($e instanceof MethodNotAllowedException) {
$allowed = $e->getAllowedMethods();
}
protected function findRoute(Request $request)
{
try {
$path = $request->getPathInfo();
$parameters = $this->getUrlMatcher($request)->match($path);
} catch (ExceptionInterface $e) {
$this->handleRoutingException($e);
}
$route = $this->routes->get($parameters['_route']);
public function dispatch(Request $request)
{
$this->currentRequest = $request;
$response = $this->callGlobalFilter($request, 'before');
if (!is_null($response)) {
$response = $this->prepare($response, $request);
} else {
$this->currentRoute = $route = $this->findRoute($request);
$response = $route->run($request);
}
}
public function dispatch(Request $request)
{
if ($this->isDownForMaintenance()) {
$response = $this['events']->until('illuminate.app.down');
return $this->prepareResponse($response, $request);
} else {
return $this['router']->dispatch($this->prepareRequest($request));
}
}
$this->fireAppCallbacks($this->shutdownCallbacks);
} else {
$this->shutdownCallbacks[] = $callback;
}
}
public function run()
{
$response = $this->dispatch($this['request']);
$this['router']->callCloseFilter($this['request'], $response);
$response->send();
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful applications we have created for them.
|
*/
$app->run();
/*