Set the current request and reset the current override.

@param Request|null $request
167884
private function setRequest(Request $request = null)
    {
        $this->request = $request;
        $this->override = null;
    }
873935
public function init($request)
    {
        $this->app->instance('request', $request);
        Facade::clearResolvedInstance('request');
        $this->bootstrap();
    }
52969
public function setRequest(Request $request)
    {
        $this->request = $request;
        $this->getContainer()->register('request', $request);
        return $this;
    }
715578
public function setRequest(BaseRequest $request)
    {
        foreach ($request as $prop => $value) {
            $this->$prop = $value;
        }
    }
1092506
public function run(Request $request = null)
    {
        if (null === $request) {
            $request = Request::createFromGlobals();
        }

        $response = $this->handle($request);
        $response->send();

        return $response;
    }
730970
public function run(HttpRequest $request = null)
    {
        if (!$this->container->getSetting('debug')) {
            error_reporting(0);
        } else {
            error_reporting(E_ALL);
        }
        
        if (!$request) {
            $request = $this->container->getRequest();
        }
        
        try {
            $parsed = $this->container->getRouter()->parse($request, $this->container->getRoutes());

            if ($parsed['found'] || $this->container->hasRoute('notFound')) {
                if (is_string($parsed['action'])) {
                    # Extract class controller and method
                    list($controller, $method) = explode('::', $parsed['action']);

                    # initialize arguments
                    $arguments = array();
                    # Create a reflection method
                    $reflectionMethod = new \ReflectionMethod($controller, $method);
                    $reflectionParams = $reflectionMethod->getParameters();
                    # Create arguments
                    foreach ($reflectionParams as $param) {
                        if ($paramClass = $param->getClass()) {
                            $className = $paramClass->name;
                            if ($className === 'MVC\\MVC' || $className === '\\MVC\\MVC') {
                                $arguments[] = $this;
                            } elseif ($className === 'MVC\\Server\\HttpRequest' || $className === '\\MVC\\Server\\HttpRequest') {
                                $arguments[] = $request;
                            }
                        } else {
                            foreach ($parsed['params'] as $keyRouteParam => $valueRouteParam) {
                                if ($param->name === $keyRouteParam) {
                                    $arguments[] = $valueRouteParam;
                                    break;
                                }
                            }
                        }
                    }

                    $response = call_user_func_array($reflectionMethod->getClosure(new $controller()), $arguments);

                    if (is_array($response) && !isset($response['body'])) {
                        throw new \LogicException("Invalid response array. Array response haven't body. Expected array('body' => 'string')");
                    } elseif (is_string($response)) {
                        $response = array('body' => $response);
                    }
                } elseif(is_callable($parsed['action'])) {
                    $this->container->getRequest()->params = $parsed['params'];

                    $response = call_user_func_array($parsed['action'], array_values($parsed['params']));
                } else {
                    throw new \LogicException('Route haven\'t action.');
                }
                if ($this->container->hasProvider('monolog')) {
                    $this->container->providers['monolog']->addInfo($response, $parsed);
                }
                $this->container->getResponse()->render($response);
            } else {
                if ($this->container->getSetting('debug')) {
                    throw new \LogicException(sprintf('Route or Resource "%s" not found.', $request->url));
                }
                $this->defaultNotFound();
            }
        } catch (\Exception $e) {
            Error::run($e);
        }
    }
435271
public function setRequest(JsonRequest $request)
    {
        $this->id = $request->getId();
        $this->jsonrpc = $request->getJsonrpc();
        $this->method = $request->getMethod();
        $this->request = $request;

        if (!$request->getResponse()) {
            $request->setResponse($this);
        }

        return $this;
    }
1269822
public function initializeRequest($request = null)
	{
		if (empty($request)) {
			$this->request = Request::createFromGlobals();
		} else {
			$this->request = $request;
		}

		// Shortcuts to the request object for cleaner syntax.
		$this->input = new Input($this->request);
	}
626142
public function setBaseRequest(ServerRequestInterface $request)
    {
        if ($request instanceof GlobalEnvironmentInterface && $request->isStale()) {
            throw new \RuntimeException("Unable to set base request: ServerRequest is stale");
        }
        
        $this->baseRequest = $request;
    }
1339232
public function route($request)
    {
        if (!self::$_cli) {
            $router = $this->get('routing');
            $router->route($request);
        }
    }
688704
public function boot($request = null)
    {
        // Initialize application
        $this->getApp()->boot($request, $this->bootstrapRegistry->getItems());

        // Set base controller router
        Controller::setRouter($this->getRouter());

        // Include routes
        include_once $this->routesConfiguration->getRoutesPath($this->getApp()->getBasePath());
    }
808942
public function setRequest(Request $request)
    {
        $this->request = $request;

        $parsedBody = $this->request->getParsedBody();

        if (!empty($parsedBody)) {
            if (is_array($parsedBody)) {
                $this->data = array_map('trim', (array)$parsedBody);
            } else {
                $this->data = $parsedBody;
            }
        }

        return $this;
    }
750822
function setRequest(\Symfony\Component\HttpFoundation\Request $request) {
        $this->request = $request;
        
        if(self::FORMAT_ARRAY_DATA_TABLES == $this->defaultFormat){
            //Ejemplo start(20) / length(10) = 2
            $start = (int)$request->get("start",0);//Elemento inicio
            $length = (int)$request->get("length",10);//Cantidad de elementos por pagina
            $this->draw = $request->get("draw",  $this->draw) + 1;//No cache
            
            if($start > 0){
                $page = (int)($start / $length);
                $page = $page + 1;
            }else{
                $page = 1;
            }
            if(!is_int($length)){
                $length = 10;
            }
            if(!is_int($page)){
                $page = 1;
            }
            $this->setMaxPerPage($length);
            $this->setCurrentPage($page);
        }else if(self::FORMAT_ARRAY_STANDARD == $this->defaultFormat){
            $page = (int)$request->get("page",1);//Elemento inicio
            $maxPerPage = (int)$request->get("maxPerPage",10);//Elemento inicio
            $this->setMaxPerPage($maxPerPage);
            $totalPages = $this->getNbPages();
            if($page > $this->getNbPages()){
                $page = $totalPages;
            }
            $this->setCurrentPage($page);
        }
    }
734296
public function changeAction(Request $request)
    {
        $regionManager = $this->get('compo_region.manager.region');

        $currentRegion = $request->request->get('current_region', $regionManager->getCurrentRegion());

        $regionManager->setCurrentRegion($currentRegion);

        return new JsonResponse($currentRegion);
    }
379550
public function setRequest($request)
    {
        if (is_string($request) && class_exists($request)) {
            $request = new $request();
            if (!$request instanceof Zend_Amf_Request) {
                require_once 'Zend/Amf/Server/Exception.php';
                throw new Zend_Amf_Server_Exception('Invalid request class');
            }
        } elseif (!$request instanceof Zend_Amf_Request) {
            require_once 'Zend/Amf/Server/Exception.php';
            throw new Zend_Amf_Server_Exception('Invalid request object');
        }
        $this->_request = $request;
        return $this;
    }
1283086
public function run(Request $request = null)
    {
        if (null === $request) {
            $request = Request::createFromGlobals();
        }

        $this->registerMiddleware('Phprest\Middleware\ApiVersion');

        $app = $this->stackBuilder->resolve($this);

        $response = $app->handle($request, self::MASTER_REQUEST, false);
        $response->send();

        $app->terminate($request, $response);
    }
761921
public function run(&$request)
    {
        $this->detect($request);
        $request = $this->driver->formatIncomingRequest($request);
    }