Populates the target path/URL property based on the request query param.

@param Request $request
163059
protected function pullTargetPathFromQuery(Request $request)
    {
        $targetPath = $request->query->get('target_path');

        if ($targetPath) {
            $this->targetPath = $targetPath;
        }
    }
361067
public function handleClientRequest($request)
    {
        $this->client_data->m = substr($request->server['path_info'], 1);
        $this->client_data->p = $request->get;
    }
577520
public function matchRequest(Request $request) {
        $context = new RequestContext();
        $context->fromRequest($request);
        $this->setContext($context);

        return($this->match($request->getPathInfo()));
    }
583957
protected function determineTargetUrl(Request $request)
    {
        if ($this->options['always_use_default_target_path']) {
            return $this->options['default_target_path'];
        }

        if ($targetUrl = $request->get($this->options['target_path_parameter'], null, true)) {
            return $targetUrl;
        }

        if (null !== $this->providerKey && $targetUrl = $request->getSession()->get('_security.'.$this->providerKey.'.target_path')) {
            $request->getSession()->remove('_security.'.$this->providerKey.'.target_path');

            return $targetUrl;
        }

        if ($this->options['use_referer'] && ($targetUrl = $request->headers->get('Referer')) && $targetUrl !== $this->httpUtils->generateUri($request, $this->options['login_path'])) {
            return $targetUrl;
        }
        return $this->options['default_target_path'];
    }
116616
public function route(Request $request)
    {
        if ($request instanceof Request\Web) {
            $server = $request->getServer();
            if (!isset($server['REQUEST_URI'])) {
                throw new Exception('REQUEST_URI is not set');
            }
            $this->logger->debug('Routing of web request', ['REQUEST_URI' => $server['REQUEST_URI']]);
            $urlComponents = explode('?', $server['REQUEST_URI']);
            $destination = reset($urlComponents);
            if (strpos($destination, $this->entryPoint) === 0) {
                $destination = substr($destination, strlen($server['SCRIPT_NAME']));
            }
        } elseif ($request instanceof Request\Cli) {
            $argv = $request->getArgv();
            $destination = isset($argv[1]) ? $argv[1] : '/';
            $this->logger->debug('Routing of CLI request', ['argv' => $argv]);
        } elseif ($request instanceof Request\Virtual) {
            $this->logger->debug(
                'Routing of virtual request',
                ['controller' => $request->getController(), 'action' => $request->getAction()]
            );
            return new Route($request->getController(), $request->getAction());
        } else {
            throw new Exception('Request type not supported');
        }

        $destination = trim($destination, '/');
        $destination = empty($destination) ? '/' : $destination;

        $this->logger->debug('Searching for corresponding route', ['destination' => $destination]);

        return $this->getRoute($destination);
    }
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);
	}
1261442
public function handleClientRequest($request)
    {
        $this->client_data->path = $request->server['path_info'];
        $route = explode('/', $request->server['path_info']);
        $count = count($route);
        if ($count == 2) {
            $this->client_data->controller_name = $route[$count - 1] ?? null;
            $this->client_data->method_name = null;
            return;
        }
        $this->client_data->method_name = $route[$count - 1] ?? null;
        unset($route[$count - 1]);
        unset($route[0]);
        $this->client_data->controller_name = implode("\\", $route);
    }
554244
public function setRequest( Request $request )
	{
		$this->request = $request;

		$this->cachedRoot = null;
		$this->cachedSchema = null;
	}
1186960
protected function processPageParams(Request $request)
    {
        if ($request->has('page') && is_numeric($request->get('page'))) {
            $this->page = $request->get('page');
        }
        if ($request->has('per_page') && is_numeric($request->get('per_page'))) {
            $this->perPage = $request->get('per_page');
        }
    }
1284036
public function handleHttpRequest($request)
    {
        $this->parseRequestBase($request);

        if (isset($request->header['x-rpc']) && $request->header['x-rpc'] == 1) {
            $this->routeParams->isRpc          = true;
            $this->routeParams->params         = $request->post ?? $request->get ?? [];
            $this->routeParams->controllerName = 'Rpc';
            $this->routeParams->methodName     = 'Index';
            $this->controllerClassName         = '\PG\MSF\Controllers\Rpc';
            $this->routeParams->path           = '/Rpc/Index';
        } else {
            if ($this->routeParams->path) {
                $this->parsePath($this->routeParams->path);
            }
        }
    }
628257
public function redirectMatching(Request $request)
    {
        $redirects = $this->storage->getRedirects()->getRedirects();
        $relativeUri = '/' . $request::$relativeUri;

        foreach ($redirects as $redirect) {
            if (preg_match_all($redirect->fromUrl, $relativeUri, $matches)) {
                $toUrl = preg_replace($redirect->fromUrl, $redirect->toUrl, $relativeUri);
                if (substr($toUrl, 0, 1) == '/') {
                    $toUrl = substr($toUrl, 1);
                }
                if ($redirect->type == '301') {
                    header('HTTP/1.1 301 Moved Permanently');
                    header('Location: ' . $request::$subfolders . $toUrl);
                    exit;
                } elseif ($redirect->type == '302') {
                    header('Location: ' . $request::$subfolders . $toUrl, true, 302);
                    exit;
                } else {
                    throw new \Exception('Invalid redirect type.');
                }
            }
        }
    }
824365
public function store(Request $request)
	{
		$attributes = request()->validate(Settings::$rules, Settings::$messages);

        $setting = $this->createEntry(Settings::class, $attributes);

        log_activity('Setting Created', 'A Setting was successfully created', $setting);

        return redirect_to_resource();
	}
264037
public function handle(Request $request)
    {
        $pathInfo = $request->getPathInfo();

        if (0 === strpos($pathInfo, $this->basePath)) {
            foreach ($this->routes as $config) {
                list($method, $pattern, $controller) = $config;

                if ($request->getMethod() === strtoupper($method)
                    && preg_match('!^' . preg_quote($this->basePath . $pattern, '!') . '$!', $request->getPathInfo())
                ) {
                    return call_user_func($controller, $request);
                }
            }
        }

        return null;
    }
72427
public function parse(\Request $request)
	{
		$uri = $request->uri->get();
		$method = $request->get_method();

		if ($uri === '' and $this->path === '_root_')
		{
			return $this->matched();
		}

		$result = $this->_parse_search($uri, null, $method);

		if ($result)
		{
			return $result;
		}

		return false;
	}
500418
public function fromRequest(Request $request)
    {
        $pageName = $request->get('page');
        $language = $request->get('_locale');
        $permalink = $request->get('permalink');
        $options = array(
            "pageName" => $pageName,
            "languageName" => $language,
            "permalink" => $permalink,
            "pageId" => (int) $request->get('pageId'),
            "languageId" => (int) $request->get('languageId'),
        );

        $this->fromOptions($options);
    }
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';
        }
    }
557901
public function setRequest($request)
    {
        $return = parent::setRequest($request);
        $this->setURLParams($this->getRequest()->allParams());

        return $return;
    }