@internal

@param Request $uri

@return array
439654
protected function parseRouteRequest (Request $request)
		{
			$routeString = preg_replace('#(^' . preg_quote(rtrim($this->getBaseUri($request), '/'), '#') . ')#', '', $request->getUri(false));
			$routeString = strtok($routeString, '#?');
			$routeString = trim($routeString, '/');

			$parsed = parent::parseRouteRequest($request);

			if (
				! in_array($parsed['method'], array('index', 'get', 'insert', 'update', 'delete'))
				&& $this->getController($request)->respondsTo($parsed['method'])
			) {
				return $parsed;

			} else if ($request->getMethod() == 'GET' && preg_match('#^[^/][^/]*$#', $routeString)) {
				return array(
					'method' => 'get',
					'arguments' => array_filter(explode('/', $routeString)),
				);

			} else if ($request->getMethod() == 'GET' && $routeString == '') {
				return array(
					'method'    => 'index',
					'arguments' => array()
				);

			} else if ($request->getMethod() == 'DELETE' && preg_match('#^[^/][^/]*$#', $routeString)) {
				return array(
					'method'    => 'delete',
					'arguments' => array_filter(explode('/', $routeString)),
				);

			} else if ($request->getMethod() == 'POST' && preg_match('#^[^/][^/]*$#', $routeString)) {
				return array(
					'method'    => 'update',
					'arguments' => array_filter(explode('/', $routeString)),
				);

			} else if ($request->getMethod() == 'POST' && $routeString == '') {
				return array(
					'method'    => 'insert',
					'arguments' => array()
				);

			} else {
				if (in_array($parsed['method'], array('index', 'get', 'insert', 'update', 'delete'))) {
					$parsed['method'] = ' non-existent method ';
				}

				return $parsed;
			}
		}
748886
static function headerOverrideArray( $uri )
    {
        $headerArray = array();

        if ( !eZHTTPHeader::enabled() )
        {
            return $headerArray;
        }

        $contentView = false;

        $uriString = eZURLAliasML::cleanURL( $uri->uriString() );

        // If content/view used, get url alias for node
        if ( strpos( $uriString, 'content/view/' ) === 0 )
        {
            $urlParts = explode( '/', $uriString );
            $nodeID = $urlParts[3];
            if ( !$nodeID )
            {
                return $headerArray;
            }

            $node = eZContentObjectTreeNode::fetch( $nodeID );
            if ( !$node )
            {
                return $headerArray;
            }

            $uriString = $node->pathWithNames();
            $contentView = true;
        }
        else
        {
            $uriCopy = clone $uri;
            eZURLAliasML::translate( $uriCopy );
            if ( strpos( $uriCopy->uriString(), 'content/view' ) === 0 )
            {
                $contentView = true;
            }
        }

        $uriString = '/' . eZURLAliasML::cleanURL( $uriString );
        $ini = eZINI::instance();

        foreach( $ini->variable( 'HTTPHeaderSettings', 'HeaderList' ) as $header )
        {
            foreach( $ini->variable( 'HTTPHeaderSettings', $header ) as $path => $value )
            {
                $path = '/' . eZURLAliasML::cleanURL( $path );
                if ( strlen( $path ) == 1 &&
                     ( !$contentView && ( $ini->variable( 'HTTPHeaderSettings', 'OnlyForContent' ) === 'enabled' ) ) &&
                     $uriString != '/' )
                {
                    continue;
                }

                if ( strpos( $uriString, $path ) === 0 )
                {
                    $config = eZStringUtils::explodeStr( $value, ';' );
                    $headerValue = $config[0];
                    $depth = isset( $config[1] ) ? $config[1] : null;
                    $level = isset( $config[2] ) ? $config[2] : null;

                    if ( $header == 'Expires' )
                    {
                        $headerValue = gmdate( 'D, d M Y H:i:s', time() + $headerValue ) . ' GMT';
                    }

                    if ( $depth === null )
                    {
                        $headerArray[$header] = $headerValue;
                    }
                    else
                    {
                        $pathLevel = count( explode( '/', $path ) );
                        $uriLevel = count( explode( '/', $uriString ) );
                        if ( $level === null )
                        {
                            if ( $uriLevel <= $pathLevel + $depth )
                            {
                                $headerArray[$header] = $headerValue;
                            }
                        }
                        else
                        {
                            if ( $uriLevel <= $pathLevel + $depth &&
                                 $uriLevel >= $pathLevel + $level )
                            {
                                $headerArray[$header] = $headerValue;
                            }
                        }
                    }
                }
            }
        }

        return $headerArray;
    }
37013
public function getArguments(string $uri, $callback = null): array
    {
        $values = [];
        $pattern = '/^' . $this->regex . '$/';
        preg_match_all($pattern, $uri, $matches);
        $matchCount = count($matches);
        for ($i = 1; $i < $matchCount; ++$i) {
            $values[] = (!is_null($callback))
                ? (new Callback($callback))->execute($matches[$i][0])
                : $matches[$i][0];
        }
        $arguments = [];
        $i = 0;
        foreach ($this->parameters as $parameter) {
            $arguments[$parameter] = $values[$i];
            ++$i;
        }
        return $arguments;
    }
903620
public function getContext(): ?array
    {
        if ($this->currentRequest === null) {
            return null;
        }

        $controller = null;

        if ($route = $this->currentRequest->route()) {
            $controller = $route->controller;

            if (! $controller && ! is_string($route->action['uses'])) {
                $controller = $route->action['uses'];
            }
        }

        return [
            'uri' => $this->currentRequest->getUri(),
            'method' => $this->currentRequest->getMethod(),
            'controller' => $controller ? $this->cloner->cloneVar(class_basename($controller)) : $controller,
            'identifier' => spl_object_hash($this->currentRequest),
        ];
    }
938358
protected function parseUri(string $uri): array
    {
        $parseAry = \parse_url($uri);

        if (!isset($parseAry['host'], $parseAry['port'], $parseAry['path'], $parseAry['query'])) {
            throw new MysqlException('Uri format error uri=' . $uri);
        }

        $parseAry['database'] = \str_replace('/', '', $parseAry['path']);
        $query                = $parseAry['query'];

        \parse_str($query, $options);

        if (!isset($options['user'], $options['password'])) {
            throw new MysqlException('Lack of username and password，uri=' . $uri);
        }

        if (!isset($options['charset'])) {
            $options['charset'] = '';
        }

        $configs = \array_merge($parseAry, $options);
        unset($configs['path'], $configs['query']);

        return $configs;
    }
795490
public function getHTTPMethods($uri) {
		$path = $this->pathHelper->getPathFromUri($uri);
		if ($this->searchBackend->getArbiterPath() === $path) {
			return ['SEARCH'];
		} else {
			return [];
		}
	}
617372
public function parse($uri)
    {
        preg_match('|^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?|', $uri, $match);

        $components = array();
        if (5 < count($match)) {
            $components =  array(
                'scheme'    => $match[2],
                'authority' => $match[4],
                'path'      => $match[5]
            );
        }
        if (7 < count($match)) {
            $components['query'] = $match[7];
        }
        if (9 < count($match)) {
            $components['fragment'] = $match[9];
        }

        return $components;
    }
368397
private function parseUri() {
		$this->env['request'] = substr($this->env['request_uri'], strlen($this->env['path']) - 1);

		if (preg_match_all('/\/([A-Za-z0-9-_]+)/', $this->env['request'], $matches)) {
			foreach ($matches[1] as $match) {
				$this->env['params'][] = $match;
			}
		}

		if (!empty($this->env['params'][0])) {
			$this->env['params']['strategy'] = $this->env['params'][0];
		}
		if (!empty($this->env['params'][1])) {
			$this->env['params']['action'] = $this->env['params'][1];
		}
	}
703393
public function getHTTPMethods($uri)
    {
        // The MKCALENDAR is only available on unmapped uri's, whose
        // parents extend IExtendedCollection
        list($parent, $name) = Uri\split($uri);

        $node = $this->server->tree->getNodeForPath($parent);

        if ($node instanceof DAV\IExtendedCollection) {
            try {
                $node->getChild($name);
            } catch (DAV\Exception\NotFound $e) {
                return ['MKCALENDAR'];
            }
        }

        return [];
    }
486870
public function loginLinkAction(Request $request)
    {
        $casLogin = $request->getSession()->get('CAS_AUTHENTICATION_USER_ID');
        if (empty($casLogin)) {
            return $this->redirectToRoute('claro_index');
        }
        $request->getSession()->set('LOGGED_VIA_CAS', true);

        return [];
    }
592680
private static function getResponse(string $uri, array $params = []): array
    {
        self::initialize();

        if (empty($params)) {
            $response = self::$client->get('api/' . self::$version . '/' . $uri);
        } else {
            $response = self::$client->post('api/' . self::$version . '/' . $uri, [
                'form_params' => $params,
            ]);
        }

        return json_decode($response->getBody(), TRUE);
    }
885155
public function getList($uri)
    {
        $returnValue = null;

        
        
        foreach($this->getLists() as $list){
        	if($list->getUri() == $uri){
        		 $returnValue = $list;
        		 break;
        	}
        }
        
        

        return $returnValue;
    }
718358
protected static RequestParams getParams(Uri uri) {
        RequestParams params = new RequestParams();
        Set<String> keys = getQueryParameterNames(uri);
        for (String key : keys) {
            String value = uri.getQueryParameter(key);
            if (TextUtils.isEmpty(value)) {
                value = null;
            }
            params.put(key, value);
        }
        return params;
    }
939225
public function parse(Uri $uri) :? array
	{
		// Get path without possible file
		$path = $uri->getPath();

		// Build route pattern
		$pattern = $this->buildRoutePattern();

		if (preg_match($pattern, $path, $matches) === 1) {

			$variables = [];
			$length = sizeof($matches);

			for ($i = 1; $i < $length; $i++) {
				$variables[$this->parameter[$i - 1]] = $matches[$i];
			}

			return $variables;
		}

		return null;
	}
1253922
protected function analyzeAsRequest(string $requestOrigin): array
	{
		$headers = [];

		// #6.1.3
		$headers['Access-Control-Allow-Origin'] = $requestOrigin;
		if ($this->settings[self::KEY_IS_USING_CREDENTIALS]) {
			$headers['Access-Control-Allow-Credentials'] = 'true';
		}
		// #6.4
		$headers['Vary'] = 'Origin';

		// #6.1.4
		$exposedHeaders = $this->getEnabledItems($this->settings[self::KEY_EXPOSED_HEADERS]);
		if (!empty($exposedHeaders)) {
			$headers['Access-Control-Expose-Headers'] = $exposedHeaders;
		}

		return $this->result(self::TYPE_ACTUAL_REQUEST, $headers);
	}
72350
private function parseUri(string $uri): array
    {
        $defaults = [
            'scheme'   => '',
            'host'     => '',
            'port'     => '',
            'user'     => '',
            'pass'     => '',
            'path'     => '',
            'query'    => '',
            'fragment' => '',
        ];

        if (0 === strpos($uri, 'file://')) {
            // parse_url botches this up
            preg_match('@file://(?P<path>[^#]*)(?P<fragment>#.*)?@', $uri, $matches);

            return array_merge($defaults, array_intersect_key($matches, $defaults));
        }

        return array_merge($defaults, array_intersect_key(parse_url($uri), $defaults));
    }
1003181
public function internalRedirect($uri)
    {
        if (is_string($uri)) {

            // make a new URI instance, then make a new request
            $uri = $this->request->getUri()->withPath($uri);
            return $this->request->withUri($uri);

        } elseif ($uri instanceof UriInterface) {

            // get a new request with the specified URI instance
            return $this->request->withUri($uri);

        } else {

            // bad $uri value
            throw new InvalidArgumentException(
                'URI should be a string or instance of Psr\Http\Message\UriInterface'
            );

        }
    }