remove dots from uri
@return string
165743
protected function removeDotsFromPath(){        
        if($this->parentLink !==null){
            $newUri = \GuzzleHttp\Psr7\UriResolver::resolve($this->parentLink,$this);
        }else{
            $newUri = $this;
        }
        $finalPath = \GuzzleHttp\Psr7\UriResolver::removeDotSegments($newUri->getPath());
        
        return $finalPath;
    }
480191
public function pathname()
    {
        $uri = $this->uri();

        // Strip the query string from the URI
        $uri = strstr($uri, '?', true) ?: $uri;

        return $uri;
    }
69005
def clean_iri(uri_string):
    ''''''
    uri_string = str(uri_string).strip()
    if uri_string[:1] == "<" and uri_string[len(uri_string)-1:] == ">":
        uri_string = uri_string[1:len(uri_string)-1]
    return uri_string
979115
public function uri() {
		$uri = self::uriTrim();
		$webRoot = self::webRoot();
		$uri = str_replace($webRoot, '', $uri);
		$uri = trim($uri, '/');
		return $uri;
	}
1238459
private function clearGitURL($url)
    {
        $partsToClean = [
            'git://',
            'git@github.com:',
            'https://',
            'github.com/',
            'raw.githubusercontent.com/',
        ];
        foreach ($partsToClean as $part) {
            $url = str_replace($part, '', $url);
        }

        if ('.git' == substr($url, -4)) {
            $url = substr($url, 0, -4);
        }

        return $url;
    }
62890
protected function getURI(): string
    {
        if (empty($this->baseUrl) || empty($this->uri)) {
            throw new Exception('Url or end point can not be null');
        }

        return $this->baseUrl . $this->uri;
    }
486523
protected function getUriPath()
    {
        $path = dirname($this->getPathFromContent());
        $parts = explode(DIRECTORY_SEPARATOR, $path);

        $uriParts = array_filter($parts, function ($dirname) {
            return false === $this->isTopLevel();
        });

        return trim(implode(DIRECTORY_SEPARATOR, $uriParts), DIRECTORY_SEPARATOR);
    }
523308
public function getUri()
	{
		if(!empty($this->data['uri'])){
			$uri =  $this->data['uri'];
		} elseif(!empty($this->data['base'])) {
			$idGenerator=$this->uniqueIdGenerator;
			$uri = $this->data['base'];
			$uri.=empty($this->data['id'])?$idGenerator($this->data):$this->data['id'];
		} else{
			$idGenerator=$this->uniqueIdGenerator;
			$uri = 'urn:local:botk:'.$idGenerator($this->data);
		}
		
		return $uri;
	}
766136
public function _uri() {
        //处理requestUri
        $requestUri = '/';

        if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch
            $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
        }
        elseif (
            // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)
            isset($_SERVER['IIS_WasUrlRewritten'])
            && $_SERVER['IIS_WasUrlRewritten'] == '1'
            && isset($_SERVER['UNENCODED_URL'])
            && $_SERVER['UNENCODED_URL'] != ''
        ) {
            $requestUri = $_SERVER['UNENCODED_URL'];
        }
        elseif (isset($_SERVER['REQUEST_URI'])) {
            $requestUri = $_SERVER['REQUEST_URI'];
            $parts = @parse_url($requestUri);

            if (isset($_SERVER['HTTP_HOST']) && strstr($requestUri, $_SERVER['HTTP_HOST'])) {
                if (false !== $parts) {
                    $requestUri = (empty($parts['path']) ? '' : $parts['path'])
                        . ((empty($parts['query'])) ? '' : '?' . $parts['query']);
                }
            }
            elseif (!empty($_SERVER['QUERY_STRING']) && empty($parts['query'])) {
                // fix query missing
                $requestUri .= '?' . $_SERVER['QUERY_STRING'];
            }
        }
        elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI
            $requestUri = $_SERVER['ORIG_PATH_INFO'];
            if (!empty($_SERVER['QUERY_STRING'])) {
                $requestUri .= '?' . $_SERVER['QUERY_STRING'];
            }
        }

        return $requestUri;
    }
1328592
public function path()
    {
        $pos = strpos($_SERVER['REQUEST_URI'], '?');

        if ($pos) {
            $uri = substr($_SERVER['REQUEST_URI'], 0, $pos);
        } else {
            $uri = $_SERVER['REQUEST_URI'];
        }

        return $uri;
    }
1010531
public function findUri()
	{
		$uri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);

		return ($this->lowerCase) ? strtolower($uri) : $uri;
	}
991168
public function preProcessURI($uri) {
        $s = preg_replace("/\{([\w]+)\}/", "[*:$1]", $uri);
            
        if (!empty($s)) {
            $uri = $s;
        }
        
        return $uri;
    }
356720
public function filterRequestUri()
    {
        if ( !empty( $this->versionToken ) )
        {
            // Remove the first occurrence of version token
            $versionSearch = '/' . $this->versionToken;
            $versionPos = strpos( $this->request->uri, $versionSearch );
            if ( $versionPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $versionPos, strlen( $versionSearch ) );
            }
        }
        if ( !empty( $this->apiProviderToken ) )
        {
            // Remove the first occurrence of API provider token
            $providerSearch = '/' . $this->apiProviderToken;
            $providerPos = strpos( $this->request->uri, $providerSearch );
            if ( $providerPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $providerPos, strlen( $providerSearch ) );
            }
        }
    }
472184
private function baseToLowercase()
    {
        if (($host = parse_url($this->uri, PHP_URL_HOST)) === null) {
            return $this->uri;
        }
        $pos = strpos($this->uri, $host) + strlen($host);
        return $this->uri = substr_replace($this->uri, strtolower(substr($this->uri, 0, $pos)), 0, $pos);
    }
71022
public function getUri()
    {
        $userPart = '';
        if ($this->getUser() !== null && $this->getPass() !== null) {
            $userPart = $this->getUser() . ':' . $this->getPass()  . '@';
        } else if ($this->getUser() !== null) {
            $userPart = $this->getUser() . '@';
        }
        $schemePart = ($this->getScheme() ? $this->getScheme() . '://' : '//');
        if (!in_array($this->getScheme(), self::getSchemesWithAuthority())) {
            $schemePart = $this->getScheme() . ':';
        }
        $portPart = ($this->getPort() ? ':' . $this->getPort() : '');
        $queryPart = ($this->getQuery() ? '?' . $this->getQuery() : '');
        $fragmentPart = ($this->getFragment() ? '#' . $this->getFragment() : '');
        if ($this->isRelative()) {
            return $this->getPath() .
            $queryPart .
            $fragmentPart;
        }
        $path = $this->getPath();
        if (0 !== strlen($path) && '/' !== $path[0]) {
            $path = '/' . $path;
        }
        return $schemePart .
        $userPart .
        $this->getHost() .
        $portPart .
        $path .
        $queryPart .
        $fragmentPart;
    }
1295891
function removeUrlPath (uri) {
  var parsed = url.parse(uri);
  if (parsed.host) {
    delete parsed.pathname;
  }
  return url.format(parsed);
}
1120208
public function parseActionName() {
		$uri = trim(get_input('__elgg_uri', ''), '/');
		$segments = explode('/', $uri);
		$handler = array_shift($segments);
		if ($handler == 'action') {
			return implode('/', $segments);
		}
		return $uri;
	}