public function run(Request $request)
    {
        $dispatcher = $this->router->getDispatcher();
        $routeInfo  = $dispatcher->dispatch($request->server('REQUEST_METHOD'), $request->server('REQUEST_URI_PATH'));

        switch ($routeInfo[0]) {
            case Dispatcher::NOT_FOUND:
                $routeInfo = $this->getNotFoundRoute($dispatcher);
                break;

            case Dispatcher::METHOD_NOT_ALLOWED:
                $routeInfo = $this->runMethodNotAllowed($dispatcher);
                break;

            case Dispatcher::FOUND:
                break;
        }

        $response = $this->runRoute($routeInfo);

        $response->send();
    }
public function run(Request $request)
    {
        $dispatcher = $this->router->getDispatcher();
        $routeInfo  = $dispatcher->dispatch($request->server('REQUEST_METHOD'), $request->server('REQUEST_URI_PATH'));

        switch ($routeInfo[0]) {
            case Dispatcher::NOT_FOUND:
                $routeInfo = $this->getNotFoundRoute($dispatcher);
                break;

            case Dispatcher::METHOD_NOT_ALLOWED:
                $routeInfo = $this->runMethodNotAllowed($dispatcher);
                break;

            case Dispatcher::FOUND:
                break;
        }

        $response = $this->runRoute($routeInfo);

        $response->send();
    }
public function run ( Request $ request ) { $ dispatcher = $ this -> router -> getDispatcher ( ) ; $ routeInfo = $ dispatcher -> dispatch ( $ request -> server ( 'REQUEST_METHOD' ) , $ request -> server ( 'REQUEST_URI_PATH' ) ) ; switch ( $ routeInfo [ 0 ] ) { case Dispatcher :: NOT_FOUND : $ routeInfo = $ this -> getNotFoundRoute ( $ dispatcher ) ; break ; case Dispatcher :: METHOD_NOT_ALLOWED : $ routeInfo = $ this -> runMethodNotAllowed ( $ dispatcher ) ; break ; case Dispatcher :: FOUND : break ; } $ response = $ this -> runRoute ( $ routeInfo ) ; $ response -> send ( ) ; }
Runs the application

This method gets the correct route for the current request and runs the callback of the route

@param \CodeCollab\Http\Request\Request $request The current request
Runs the application