Get current URL

@param string $uri = NULL

@return string
771094
public static function current(String $fix = NULL) : String
    {
        $currentUrl = Request::getHostName(Server::data('requestUri'));

        if( ! empty($fix) )
        {
            # It allows the parametric value to be inserted after the / symbol.
            # If the parametric value is present, it is not appended to the end of the URI.
            return Base::suffix(Base::removeSuffix($currentUrl, $fix)) . $fix;
        }

        return $currentUrl;
    }
533639
public static function getURI() {
        if (isset($_SERVER ['REQUEST_URI'])) {
            if (WWWROOT_DIR != '/') {
                $uri = substr($_SERVER ['REQUEST_URI'], strlen(WWWROOT_DIR) - 1);
            } else {
                $uri = $_SERVER ['REQUEST_URI'];
            }

            return $uri;
        }

        return null;
    }
1188939
protected function getActualUri( $uri )
	{
		foreach ( $this->rewriteURIs as $prefix => $rewriteUri )
		{
			if ( strpos( $uri, $prefix ) !== 0 ) continue;
			$actualUri =  str_replace( $prefix, $rewriteUri, $uri );
			$actualUri = XBRL::normalizePath( $this->getFirstFolderName() . "/" . XBRL_TaxonomyPackage::metaFolderName . "/" . $actualUri );
			return $actualUri;
		}

		return $uri;
	}
621705
protected function getCurrentUri()
  {
    // Get the current Request URI and remove rewrite base path from it (= allows one to run the router in a sub folder)
    $uri = substr($_SERVER['REQUEST_URI'], strlen($this->getBasePath()));
    // Don't take query params into account on the URL
    if (strstr($uri, '?')) {
      $uri = substr($uri, 0, strpos($uri, '?'));
    }
    // Remove trailing slash + enforce a slash at the start
    return '/' . trim($uri, '/');
  }
1058833
public function baseUrl($uri = '')
    {
        return sprintf(
            "%s://%s%s%s%s",
            isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
            $_SERVER['SERVER_NAME'],
            ($_SERVER['SERVER_PORT'] == 80) ?: ':' . $_SERVER['SERVER_PORT'],
            $_SERVER['REQUEST_URI'],
            ltrim($uri, '/')
        );
    }
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;
    }
82635
protected function versionPath(string $uri)
    {
        if ($this->version === null || preg_match(self::VERSION_PATTERN, $uri)) {
            // No version set, or already versioned... nothing to do
            return $uri;
        }

        // Graph request
        if ($this->isGraphRequest($uri)) {
            return str_replace('/admin/api', "/admin/api/{$this->version}", $uri);
        }

        // REST request
        return preg_replace('/\/admin(\/api)?\//', "/admin/api/{$this->version}/", $uri);
    }
678260
protected function _uri_string($uri)
	{
		if ($this->item('enable_query_strings') == FALSE)
		{
			if (is_array($uri))
			{
				$uri = implode('/', $uri);
			}
			$uri = trim($uri, '/');
		}
		else
		{
			if (is_array($uri))
			{
				$i = 0;
				$str = '';
				foreach ($uri as $key => $val)
				{
					$prefix = ($i == 0) ? '' : '&';
					$str .= $prefix.$key.'='.$val;
					$i++;
				}
				$uri = $str;
			}
		}
	    return $uri;
	}
473718
public function getHttpClient( $uri = null )
    {
        $client = clone $this->httpClient;

        if ( $uri )
        {
            $client->setUri( $uri );
        }

        return $client;
    }
1235420
public function createUrlFromUri($uri)
    {
        $uri = ltrim($uri, '/');

        return empty($this->baseUrl)
            ? $this->app[\Illuminate\Contracts\Routing\UrlGenerator::class]->to($uri)
            : $this->baseUrl.$uri;
    }
722045
public function getRedirectUri()
	{
		return null === $this->loginAgentUrl ? $this->callbackUrl : ($this->loginAgentUrl . '?' . http_build_query(array('redirect_uri'=>$this->callbackUrl)));
	}
899669
protected function parseUrl($uri)
    {
        $parsedUrl = parse_url($uri);

        return [
            isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] : '',
            isset($parsedUrl['host']) ? $parsedUrl['host'] : '',
            isset($parsedUrl['port']) ? $parsedUrl['port'] : null,
            isset($parsedUrl['path']) ? $parsedUrl['path'] : '/',
            isset($parsedUrl['query']) ? $parsedUrl['query'] : '',
            isset($parsedUrl['fragment']) ? $parsedUrl['fragment'] : '',
            isset($parsedUrl['user']) ? $parsedUrl['user'] : '',
            isset($parsedUrl['pass']) ? $parsedUrl['pass'] : ''
        ];
    }
910074
public static function getDomain($uri)
    {
        $returnValue = parse_url($uri, PHP_URL_HOST);
        if (empty($returnValue)) {
            return null;
        }

        return $returnValue;
    }
243290
protected function prepareUrlForRequest($uri)
    {
        if (Str::startsWith($uri, '/')) {
            $uri = substr($uri, 1);
        }

        if (! Str::startsWith($uri, 'http')) {
            $uri = ($this->baseUrl ?? config('app.url')) . '/' . $uri;
        }

        return trim($uri, '/');
    }
459974
public function GetRoute($uri = "")
	{
		$match = '';
		
		$qs = $uri ? $uri : (array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : '');
		$parsed = explode('&', $qs,2);
		$action = $parsed[0];
		
		if (strpos($action, '=') > -1 || !$action) {
			// the querystring is empty or the first param is a named param, which we ignore
			$match = $this->defaultAction;
		}
		else {
			// otherwise we have a route.  see if we have a match in the routemap, otherwise return the 'not found' route
			$method = RequestUtil::GetMethod();
			$route = $method.':'.$action;
			$match = array_key_exists($route, $this->routes) ? $this->routes[$route]['route'] : self::$ROUTE_NOT_FOUND;
		}
		
		return explode('.',$match,2);
	}
1348992
static public function getRoute($uri = null)
    {
        $routes = self::$instance->routes;
        if($uri === null) {
            foreach($routes as $i => $route) {
                $routes[$i] = \array_diff_key($routes[$i], [3 => "xy", 4 => "xy", 5 => "xy", 6 => "xy", 7 => "xy", 8 => "xy"]);
                if( !is_string($routes[$i][2]) && is_object($routes[$i][2]) && is_callable($routes[$i][2]) && $routes[$i][2] instanceof \Closure) {
                    $routes[$i][2] = "Closure";
                }
            }
            return $routes;
        }
        else {
            foreach($routes as $i => $route) {
                if($route[1] === "/".ltrim($uri,"/")) {
                    return $route;
                }
            }
        }
    }
894484
public static function getRelativeUrl($url = null) {
        $url = is_null($url) ? '/'.ltrim($_SERVER['REQUEST_URI'], '/') : $url;
        $rootUrlPath	= parse_url(ROOT_URL, PHP_URL_PATH);
        $absPath		= parse_url($url, PHP_URL_PATH);
        if (substr($absPath, 0, strlen($rootUrlPath)) != $rootUrlPath ) {
            throw new ResolverException('Request Uri '.$url.' outside of TAO path '.ROOT_URL);
        }
        if ($absPath === $rootUrlPath) {
            $result = '';
        } else {
            $result = substr($absPath, strlen($rootUrlPath));
        }
        return $result;
    }