Check if the passed internal URL has a public url alias.

@param string $internalUrl
@param bool $asObject
@param integer $mode
@return null|string|UrlAlias
328528
public function hasPublicAlias($internalUrl, $asObject = false, $mode = UrlAlias::REWRITE)
    {
        $ret = null;

        if ($alias = $this->repository->findOneByInternalUrl($internalUrl, $mode)) {
            $ret = ($asObject ? $alias : $alias->getPublicUrl());
        }

        return $ret;
    }
18832
public function checkRedirectUrl($eventObject) {
        $esiHelper = Mage::helper('turpentine/esi');
        $url = $eventObject->getTransport()->getUrl();
        $referer = Mage::helper('core/http')->getHttpReferer();
        $dummyUrl = $esiHelper->getDummyUrl();
        $reqUenc = Mage::helper('core')->urlDecode(
            Mage::app()->getRequest()->getParam('uenc') );

        if ($this->_checkIsEsiUrl($url)) {
            if ($this->_checkIsNotEsiUrl($reqUenc) &&
                    Mage::getBaseUrl() == $url) {
                $newUrl = $this->_fixupUencUrl($reqUenc);
            } elseif ($this->_checkIsNotEsiUrl($referer)) {
                $newUrl = $referer;
            } else {
                $newUrl = $dummyUrl;
            }
            // TODO: make sure this actually looks like a URL
            $eventObject->getTransport()->setUrl($newUrl);
        }

        if ($eventObject->getTransport()->getUrl() != $url) {
            Mage::helper('turpentine/debug')->logDebug(
                'Detected redirect to ESI URL, changing: %s => %s',
                $url, $eventObject->getTransport()->getUrl() );
        }
    }
704157
public function repository_from_url(string $url, bool $obj = false){
    $repository = '';
    $repositories = $this->repositories();

    foreach ( $repositories as $i => $d ){
      if ( (strpos($url, $i) === 0) &&
        (\strlen($i) > \strlen($repository) )
      ){
        $repository = $i;
      }
    }
    if ( !empty($repository) ){
      return empty($obj) ? $repository : $repositories[$repository];
    }
    return false;
  }
79367
static function localeList( $asObject = false, $withVariations = true )
    {
        $locales =& $GLOBALS['eZLocaleLocaleStringList'];
        if ( !is_array( $locales ) )
        {
            $localeRegexp = eZLocale::localeRegexp( $withVariations, false );
            $locales = array();
            $dir = opendir( 'share/locale' );
            while( ( $file = readdir( $dir ) ) !== false )
            {
                if ( preg_match( "/^($localeRegexp)\.ini$/", $file, $regs ) )
                {
                    $locales[] = $regs[1];
                }
            }
            closedir( $dir );
            $locales = array_unique( $locales );
            sort( $locales );
            if ( $asObject )
            {
                $localeObjects = array();
                foreach ( $locales as $locale )
                {
                    $localeInstance = eZLocale::instance( $locale );
                    if ( $localeInstance )
                        $localeObjects[] = $localeInstance;
                }
                $locales = $localeObjects;
            }
        }
        return $locales;
    }
832418
public static function currentUrl(bool $includeQuery = true, bool $urlEncode = false)
    {
        if (RequestHelper::isCli()) {
            return null;
        }

        $url = static::protocolHostPort() . static::currentUri($includeQuery, $urlEncode);

        return $urlEncode ? urlencode($url) : $url;
    }
93803
function(object) {
      if (object instanceof ModelClass) {
        return object.url();
      }
      if (object instanceof ModelInstance || isFunc(object.$model)) {
        var model = object.$model();
        return expr(object, model.$config().identity + '.href').get() || model.url();
      }
      throw new Error('Could not get URL for ' + typeof object);
    }
814875
public function getExitPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
    {
        Piwik::checkUserHasViewAccess($idSite);

        $dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
        $this->filterNonExitActions($dataTable);
        return $dataTable;
    }
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'
            );

        }
    }
201190
private function apiUrl($url = '', $format = 'json')
    {
        if (!$url) {
            return false;
        }

        $absUrl = sprintf('https://%s/pms/v%d/%s/%s', 
                          $this->apiBase,
                          $this->version,
                          $format,
                          $url);

        return (string) $absUrl;
    }
126135
public static function referrer($isInternal = true)
    {
        if (! isset(self::$_referrer)) {
            if ($referrer = AnRequest::get('server.HTTP_REFERER', 'url')) {
                self::$_referrer = AnService::get('anahita:http.url', array('url' => $referrer));

                if ($isInternal) {
                    if (! AnService::get('anahita:filter.internalurl')->validate((string) self::$_referrer)) {
                        return null;
                    }
                }
            }
        }

        return self::$_referrer;
    }
1211098
function pathObjectUrl($entity, $type = LinkGeneratorService::TYPE_LINK_DEFAULT, array $parameters = array()) {
        if($entity === null){
            return "";
        }
        return $this->linkGeneratorService->generateOnlyUrl($entity, $type, $parameters);
    }
52304
protected function getUrlAliases($object)
    {
        try {
            $internalUrl = $this->provider->url($object);
        } catch (UnsupportedException $exception) {
            return [];
        }

        return $this
            ->doctrine
            ->getRepository('ZichtUrlBundle:UrlAlias')
            ->findAllByInternalUrl($internalUrl);
    }
122692
private function getRouteParametersByInternalName($internalName, $locale, $parameters = array())
    {
        $url = '';
        $translation = $this->em->getRepository('KunstmaanNodeBundle:NodeTranslation')
            ->getNodeTranslationByLanguageAndInternalName($locale, $internalName);

        if (!is_null($translation)) {
            $url = $translation->getUrl();
        }

        return array_merge(
            array(
                'url' => $url,
                '_locale' => $locale,
            ),
            $parameters
        );
    }
892024
protected function isExternalUrl(string $url): bool
    {
        return (!filter_var($url, FILTER_VALIDATE_URL) === false) && (strpos($url, 'vfs://') === false);
    }
130907
public static function getUrlsByParentId($isSuper, $menuIdList, $parentId, $condition = '', $params = [], $order = 'display_order asc')
    {
        $data = static::find()
            ->normal()
            ->findByParentId($parentId)
            ->andWhere($condition, $params)
            ->active()
            ->orderBy($order)
            ->asArray()
            ->all();
        $urls = [];
        if ($data) {
            foreach ($data as $item) {
                if ($isSuper || in_array($item['menu_id'], $menuIdList)) {
                    $menuUrls = DpAdminMenuUrlRelation::getAllUrlByMenuId($item['menu_id']);
                    if ($menuUrls) {
                        foreach ($menuUrls as $menuUrl) {
                            $urls[$menuUrl['alias']] = Url::toRoute($menuUrl['route']);
                        }
                    }
                    $childrenUrls = static::getUrlsByParentId($isSuper, $menuIdList, $item['menu_id'], $condition, $params, $order);
                    if ($childrenUrls) {
                        $urls = array_merge($urls, $childrenUrls);
                    }
                }
            }
        }

        return $urls;
    }
755703
private function prepareRequest(InternalRequestInterface $internalRequest)
    {
        $uri = $internalRequest->getUri();
        $path = $uri->getPath().($uri->getQuery() ? '?'.$uri->getQuery() : '');

        $request = $internalRequest->getMethod().' '.$path.' HTTP/'.$internalRequest->getProtocolVersion()."\r\n";
        $request .= 'Host: '.$uri->getHost().($uri->getPort() !== null ? ':'.$uri->getPort() : '')."\r\n";
        $request .= implode("\r\n", $this->prepareHeaders($internalRequest, false, true, true))."\r\n\r\n";
        $request .= $this->prepareBody($internalRequest)."\r\n";

        return $request;
    }
1271853
public function objectUrl($code, $action, $object, $parameters = [], $absolute = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        list($action, $code) = $this->getCodeAction($code, $action);

        return $this->getAdminPool()->getAdminByAdminCode($code)->generateObjectUrl($action, $object, $parameters, $absolute);
    }