/*!
\return an url alias for the current node. It will generate a unique alias.
359237
function pathWithNames( $regenerateCurrent = false )
    {
        // Only set name if current node is not the content root
        $ini = eZINI::instance( 'content.ini' );
        $contentRootID = $ini->variable( 'NodeSettings', 'RootNode' );
        if ( $this->attribute( 'node_id' ) != $contentRootID )
        {
            $pathArray = $this->pathArray();
            // Get rid of node with ID 1 (a special node)
            array_shift( $pathArray );
            if ( $regenerateCurrent )
            {
                // Get rid of current node, path element for this will be calculated
                array_pop( $pathArray );
            }
            if ( count( $pathArray ) == 0 )
            {
                $path = '';
            }
            else
            {
                $path = eZURLAliasML::fetchPathByActionList( "eznode", $pathArray, $this->CurrentLanguage );
            }

            // Fallback in case fetchPathByActionList() fails,
            // then we ask for the path from the parent and generate the current
            // entry ourselves.
            if ( $path === null )
            {
                if ( $this->attribute( 'depth' ) == 0 ) // Top node should just return empty string
                {
                    return '';
                }

                eZDebug::writeError( __METHOD__ . "() failed to fetch path of node " . $this->attribute( 'node_id' ) . ", falling back to generated url entries. Run updateniceurls.php to fix the problem." );

                // Return a perma-link when the path lookup failed, this link will always work
                $path = 'content/view/full/' . $this->attribute( 'node_id' );
                return $path;
            }

            if ( $regenerateCurrent )
            {
                $nodeName = $this->attribute( 'name' );
                $nodeName = eZURLAliasML::convertToAlias( $nodeName, 'node_' . $this->attribute( 'node_id' ) );

                if ( $path != '' )
                {
                    $path .= '/' . $nodeName ;
                }
                else
                {
                    $path  = $nodeName ;
                }
            }
        }
        else
        {
            $path = '';
        }

        if ( $regenerateCurrent )
        {
            $path = $this->checkPath( $path );
        }
        return $path;
    }
960377
public static function getCurrentUrl()
    {
        if (isset($_SERVER['HTTPS']) &&
            ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
            isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
            $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
            $protocol = 'https';
        }
        else {
            $protocol = 'http';
        }

        return "$protocol://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    }
676079
public function getCurrentUrl()
    {
        $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
        $path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
        return $this->getCurrentScheme() . '://' . $host . $path;
    }
1231923
protected function currentUrl()
    {
        if (isset(static::$static[__FUNCTION__])) {
            return static::$static[__FUNCTION__];
        }
        $url = $this->currentUrlScheme().'://';
        $url .= $this->currentUrlHost();
        $url .= $this->currentUrlUri();

        return static::$static[__FUNCTION__] = $url;
    }
756664
function root (options$$1, next) {

    var url = next(options$$1);

    if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) {
        url = trimEnd(options$$1.root, '/') + '/' + url;
    }

    return url;
}
719553
function alias($name,$params=[],$query=NULL) {
		if (!is_array($params))
			$params=$this->parse($params);
		if (empty($this->hive['ALIASES'][$name]))
			user_error(sprintf(self::E_Named,$name),E_USER_ERROR);
		$url=$this->build($this->hive['ALIASES'][$name],$params);
		if (is_array($query))
			$query=http_build_query($query);
		return $url.($query?('?'.$query):'');
	}
967860
public function urlMatches(Url $url)
    {
        $currentPath = $this->branches->getPath();
        $urlSegments = array();

        foreach ($url->getSegments() as $urlSegment) {
            $found = false;
            $realPathSegment = $urlSegment;
            $realUrlSegment = $urlSegment;

            /** @var DirectoryIterator $nodePath */
            foreach (new RecursiveDirectoryIterator($currentPath, FilesystemIterator::SKIP_DOTS) as $nodePath) {
                if ($found) {
                    break;
                }

                $pathSegment = $nodePath->getFilename();

                if (($realUrlSegment = $this->segmentMatches($urlSegment, $pathSegment))) {
                    $found = true;
                    $realPathSegment = $pathSegment;
                }
            }

            if (!$found) {
                return false;
            }

            $currentPath .= '/'.$realPathSegment;
            $urlSegments[] = $realUrlSegment;
        }

        $realUrl = new Url(implode('/', $urlSegments));

        return new Location($realUrl, $currentPath);
    }
1070234
function urlAlias()
    {
        $useURLAlias =& $GLOBALS['eZContentObjectTreeNodeUseURLAlias'];
        $ini = eZINI::instance();
        $cleanURL = '';
        if ( !isset( $useURLAlias ) )
        {
            $useURLAlias = $ini->variable( 'URLTranslator', 'Translation' ) == 'enabled';
        }
        if ( $useURLAlias )
        {
            $path = $this->pathWithNames();
            if ( $ini->hasVariable( 'SiteAccessSettings', 'PathPrefix' ) &&
                 $ini->variable( 'SiteAccessSettings', 'PathPrefix' ) != '' )
            {
                $prepend = $ini->variable( 'SiteAccessSettings', 'PathPrefix' );
                $pathIdenStr = substr( $prepend, strlen( $prepend ) -1 ) == '/'
                                ? $path . '/'
                                : $path;
                if ( strncasecmp( $pathIdenStr, $prepend, strlen( $prepend ) ) == 0 )
                    $cleanURL = eZURLAliasML::cleanURL( substr( $path, strlen( $prepend ) ) );
                else
                    $cleanURL = eZURLAliasML::cleanURL( $path );
            }
            else
            {
                $cleanURL = eZURLAliasML::cleanURL( $path );
            }
        }
        else
        {
            $cleanURL = eZURLAliasML::cleanURL( 'content/view/full/' . $this->NodeID );
        }

        return $cleanURL;
    }
347777
public static function getDomainFromURL($url)
	{
		$url = str_replace(self::getProtocolFromURL($url) . '://', '', $url);
		
		return explode('/', $url)[0];
	}
211315
private function getCurrentUrlPath()
    {
        if ($this->path) {
            return $this->path;
        }

        /**
         * check if the path is empty otherwise
         * set it with the server variable and if there's no server variable set it as the default delimiter [/] the root
         */
        $this->path = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null;
        $this->urlPart = $this->parsePath($this->path);

        return $this->path;
    }
28762
public static function getNodePath($node)
    {
        $result = '';
        if ($node instanceof static) {
            $result = $node->slug;
            if (!empty($node->parent_id)) {
                $parent = static::node($node->parent_id);
                if (!empty($parent)) {
                    $result = static::getNodePath($parent) . '/' . $result;
                }
            }
        }
        return $result;
    }
1279361
function alias($name,$params=NULL,$lang=NULL) {
		if (in_array($name,$this->global_aliases))
			return $this->f3->alias($name,$params);
		if (!is_array($params))
			$params=$this->f3->parse($params);
		if (!$lang)
			$lang=$this->current;
		if (isset($this->rules[$lang][$name]) && $this->rules[$lang][$name]===FALSE)
			return FALSE;
		$url=isset($this->rules[$lang][$name])?
			$this->rules[$lang][$name]:@$this->_aliases[$name];
		if (!$url)
			user_error(sprintf(\Base::E_Named,$name),E_USER_ERROR);
		return $this->f3->build(rtrim('/'.$lang.$url,'/'),$params);
	}
88681
public static function GetCallingURL()
    {
        $sURL = '/';
        if (array_key_exists(self::SESSION_PARAM_NAME, $_SESSION)) {
            $sURL = $_SESSION[self::SESSION_PARAM_NAME];
        } else {
            $sURL = self::getPageService()->getLinkToPortalHomePageAbsolute();
        }

        return $sURL;
    }
1094123
public function getCanonicalUrl()
    {
        $url = '';
        if ($content = $this->getContent()) {
            $utils = \OxidEsales\Eshop\Core\Registry::getUtilsUrl();
            if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) {
                $url = $utils->prepareCanonicalUrl($content->getBaseSeoLink($content->getLanguage()));
            } else {
                $url = $utils->prepareCanonicalUrl($content->getBaseStdLink($content->getLanguage()));
            }
        }

        return $url;
    }
732386
private function currentURL() {
        $pageURL = 'http';
        if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
            $pageURL .= "s";
        }
        $pageURL .= "://";
        if ($_SERVER["SERVER_PORT"] != "80") {
            $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
        } else {
            $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
        }
        return $pageURL;
    }
394308
function getCurrent(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $args = $this->parseArguments($helper->render($value), 'params', ['scheme' => false]);
      return UrlHelper::current($args['params'], $args['scheme']);
    };
  }
774829
public static function getCurrentUrl()
    {
        return self::getCurrentScheme() . '://'
        . self::getCurrentHost()
        . self::getCurrentScriptName(false)
        . self::getCurrentQueryString();
    }