Set Route Info

@param $request RequestContract
10338
protected function setRouteInfo($request)
    {
        $this->route_info = Route::getWebInfo($request);
        if (!$this->route_info['controller'] || !$this->route_info['action']) {
            $this->route_info['controller'] = 'index';
            $this->route_info['action'] = 'index';
            $home = Lb::app()->getHome();
            if (isset($home['controller']) && isset($home['action']) && $home['controller'] && $home['action']) {
                $this->route_info['controller'] = $home['controller'];
                $this->route_info['action'] = $home['action'];
            }
        }
    }
167884
private function setRequest(Request $request = null)
    {
        $this->request = $request;
        $this->override = null;
    }
1322304
public function bindRequest(Request $request)
    {
        $this->request = $request;

        foreach ($this->request->postArray() as $key => $value) {
            if (isset($this->fieldSet[$key])) {
                $this->fieldSet[$key]->setValue($value);
            }
        }
    }
983820
public function route(Request &$request)
	{
		$matcher = $this->routerContainer->getMatcher();
		$route = $matcher->match($request);
		if (!$route) {
			return false;
		}

		foreach ($route->extras as $key => $val) {
			$request = $request->withAttribute($key, $val);
		}
		foreach ($route->attributes as $key => $val) {
			$request = $request->withAttribute($key, $val);
		}
		$request = $request->withAttribute('route.name', $route->name);

		return $route->handler;
	}
695484
public static function setRequest(RequestInterface $request)
    {
        $coroutineId = self::getCoroutineId();
        self::$context[$coroutineId][self::REQUEST_KEY] = $request;
    }
1013706
public function dispatch(Request $request) {

        $uri = $request->uri();
        $method = $request->method();

        if (in_array($uri, self::$routes)) {
            if (self::$methods[$uri] == $method || self::$methods[$uri] == 'ANY') {
                if (is_object(self::$callbacks[$uri])) {
                     call_user_func(self::$callbacks[$uri]);
                } else {
                    $s = explode('@', self::$callbacks[$uri]);
                    call_user_func(array((new $s[0]), $s[1]));
                }
            }
        } else {
            header($_SERVER['SERVER_PROTOCOL']." 404 Not Found");
            echo '404';
        }
    }
890452
protected function prepRoutes(ServerRequestInterface $request) : void
    {
        $this->processGroups($request);
        $this->buildNameIndex();

        $routes = array_merge(array_values($this->routes), array_values($this->namedRoutes));

        foreach ($routes as $key => $route) {
            // check for scheme condition
            if (! is_null($route->getScheme()) && $route->getScheme() !== $request->getUri()->getScheme()) {
                continue;
            }

            // check for domain condition
            if (! is_null($route->getHost()) && $route->getHost() !== $request->getUri()->getHost()) {
                continue;
            }

            // check for port condition
            if (! is_null($route->getPort()) && $route->getPort() !== $request->getUri()->getPort()) {
                continue;
            }

            if (is_null($route->getStrategy())) {
                $route->setStrategy($this->getStrategy());
            }

            $this->addRoute($route->getMethod(), $this->parseRoutePath($route->getPath()), $route);
        }
    }
942770
public function setRequest(Request $request)
    {
        $files = $request->files->all();

        $files = is_array($files) ? array_filter($files) : $files;

        $this->initialize(
            $request->query->all(), $request->request->all(), $request->attributes->all(),
            $request->cookies->all(), $files, $request->server->all(), $request->getContent()
        );

        if ($session = $request->getSession()){

            $this->setSession($session);

        }

        $this->setUserResolver($request->getUserResolver());

        $this->setRouteResolver($request->getRouteResolver());
    }
512550
protected function setupRouter(Request $request)
    {
        if ($request instanceof Request\Web) {
            $router = $this->getRouter();
            if (
                $router instanceof Router\RouterCuInterface
                && $router->isRequestedUrlClean($request))
            {
                $router->enableCleanUrls();
            }
        }

        return $this;
    }
201558
public function setRequest(Request $request)
    {
        $context = (new RequestContext())->fromRequest($request);

        $this->cachedRoot = null;
        $this->cachedSchema = null;
        return $this->setContext($context);
    }
258241
public static function initialize($request)
    {
        Menu::setPrimaryMenuID();

        //Backend
        if (isInAdmin()) {
            $menuLinkID = (is_numeric(Input::get('menu_link_id')) ? Input::get('menu_link_id') : false);
            if($menuLinkID) {
                self::setCurrent(self::findByID($menuLinkID));
            }
        }else{ // frontend
            Post::sethomepage();

            // Set active menulinks
            self::setActiveIDs();

            // Set home page MenuLink if home page is requested
            $getCurrentPath = Request::path();
            if($getCurrentPath == '/' || $getCurrentPath == App::getLocale()) {
                self::setCurrent(Post::gethomepage());
            }else if(self::getActiveIDs()) {
                //or if any other menulink is active
                self::setCurrent(self::findByID(array_first(self::getActiveIDs())));
            }

            // Front page should not have duplicate urls
            if(Request::route('postSlug') && Request::route('postSlug') == Post::gethomepage()->slug) {
                Redirect::to('/', 301)->send();
            }
        }
    }
1030273
public function addRoute($request, $destinationController) {
        $explodedDestination = explode('/', $destinationController);
        if (file_exists(CONTROLLERS . DS . ucfirst($explodedDestination[0]) . '_Controller.php')) {
            $this->_routes[$request] = $destinationController;
        } else {
            throw new RoutingException('Non existant MVC route specified: ' . $destinationController);
        }
    }
466775
public function setLastRequestTime(RequestInterface $request)
    {
        $route = $this->getRoute($request);
        $key   = $this->getKey($route.'.lastRequest');

        $this->redis->setex($key, static::MAX_TTL, $this->getRequestTime($request));
    }
295204
protected function bindPathParameters(Request $request)
    {
        preg_match($this->compiled->getRegex(), '/' .$request->decodedPath(), $matches);

        return $matches;
    }
12677
public function bindRequest(Request $request)
    {
        $query = $request->query;
        $session = $request->getSession();

        $adminListName = 'listconfig_' . $request->get('_route');

        $this->page = $request->query->getInt('page', 1);
        $this->limit = $request->query->getInt('limit', $this->getLimitOptions()[0]);

        $adminListSessionData = $request->getSession()->get($adminListName);
        if (!$query->has('limit') && null !== $adminListSessionData && isset($adminListSessionData['limit'])) {
            $this->limit = $adminListSessionData['limit'];
        }

        if ($request->query->has('limit') && !$request->query->has('page')) {
            $this->page = 1;
        }

        // Allow alphanumeric, _ & . in order by parameter!
        $this->orderBy = preg_replace('/[^[a-zA-Z0-9\_\.]]/', '', $request->query->get('orderBy', ''));
        $this->orderDirection = $request->query->getAlpha('orderDirection', '');

        // there is a session and the filter param is not set
        if ($session->has($adminListName) && !$query->has('filter')) {
            if (!$query->has('page') && !$query->has('limit')) {
                $this->page = $adminListSessionData['page'];
            }

            if (!$query->has('orderBy')) {
                $this->orderBy = $adminListSessionData['orderBy'];
            }

            if (!$query->has('orderDirection')) {
                $this->orderDirection = $adminListSessionData['orderDirection'];
            }
        }

        // save current parameters
        $session->set(
            $adminListName,
            [
                'page' => $this->page,
                'limit' => $this->limit,
                'orderBy' => $this->orderBy,
                'orderDirection' => $this->orderDirection,
            ]
        );

        // Remove limit from query param so it doesn't affect the session of the filter builder
        $request->query->remove('limit');
        $this->getFilterBuilder()->bindRequest($request);
    }
339796
public function setRequest(Request $request)
    {
        $this->request = $request;

        $this->input = $request->request->all() + $request->query->all();
    }
1355507
public function findHttpRoute(Request $request)
    {
        $route = Assist::extractBeforeNeedle($request->queryPath(), '?');

        if (!$this->has($route)) {
            throw new Base('No route has been found for this url');
        }

        $data = $this->find($route);
        if (!in_array(strtolower(strtolower($request->method())), array_keys($data))) {
            throw new Base(
                'This route only accepts the "' .
                implode(', ', array_keys($data)) . '" http method(s)'
            );
        }

        $httpMethod = strtolower($request->method());

        return new Parameters($data[$httpMethod]);
    }