Gets the reference type depending on the option and the generated route
host.

@param bool $absoluteUrlOption The received absolute url option.

@return bool The reference type.
509420
private function getReferenceType($absoluteUrlOption = false)
    {
        return ($this->generatedRouteHost || $absoluteUrlOption)
            ? UrlGeneratorInterface::ABSOLUTE_URL
            : UrlGeneratorInterface::ABSOLUTE_PATH;
    }
74745
public function findOneAbsoluteRoot() : ?Page
    {
        if (!$this->absoluteRoot)
        {
            $this->absoluteRoot = PageQuery::create()
                ->findRoot();
        }

        return $this->absoluteRoot;
    }
27085
public function getAbsoluteUrl($strip = true)
    {
        $url = $this->getHostInfo() . $this->getUrl();
        return $strip === true ? strip_tags($url) : $url;
    }
1294148
public static function getReferer($full = false) {
		$ref = env('HTTP_REFERER');
		$forwarded = env('HTTP_X_FORWARDED_HOST');
		if ($forwarded) {
			$ref = $forwarded;
		}
		if (empty($ref)) {
			return $ref;
		}
		if ($full) {
			$ref = Router::url($ref, $full);
		}
		return $ref;
	}
284520
public function getBrowserPath($path, $filter, $absolute = false)
    {
        // identify if current path is not under specified source root and return
        // unmodified path in that case
        $realPath = realpath($this->sourceRoot.$path);

        if (!0 === strpos($realPath, $this->sourceRoot)) {
            return $path;
        }

        $path = str_replace(
            urlencode(ltrim($path, '/')),
            urldecode(ltrim($path, '/')),
            $this->router->generate('_imagine_'.$filter, array(
                'path' => ltrim($path, '/')
            ), $absolute)
        );
        
        $cached = realpath($this->webRoot.$path);

        if (file_exists($cached) && !is_dir($cached) && filemtime($realPath) > filemtime($cached)) {
            unlink($cached);
        }

        return $path;
    }
309922
public function route($absolute = false, $domain = false)
    {
        return ($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths);
    }
934143
function absoluteURI(uri, base) {
    if (uri.substr(0, 2) == './')
      uri = uri.substr(2);

    // absolute urls are left in tact
    if (uri.match(absUrlRegEx) || uri.match(protocolRegEx))
      return uri;
    
    var baseParts = base.split('/');
    var uriParts = uri.split('/');
    
    baseParts.pop();
    
    while (curPart = uriParts.shift())
      if (curPart == '..')
        baseParts.pop();
      else
        baseParts.push(curPart);
    
    return baseParts.join('/');
  }
402044
public function viewImage(ImageInterface $imageMedia, $absoluteUrl = false)
    {
        $this->prepareRouterContext();

        $routeReferenceType = $this->getReferenceType($absoluteUrl);

        $generatedRoute = $this
            ->router
            ->generate($this->imageViewControllerRouteName, [
                'id' => (int) $imageMedia->getId(),
                '_format' => $imageMedia->getExtension(),
            ], $routeReferenceType);

        $this->fixRouterContext();

        return $generatedRoute;
    }
980837
public static function getUrl($resource, $absolute = false) {
		if (strpos ( $resource, '//' ) !== false) {
			return $resource;
		}
		if ($absolute) {
			return self::$siteURL . self::ASSETS_FOLDER . $resource;
		}
		return ltrim ( self::ASSETS_FOLDER, '/' ) . $resource;
	}
264659
public function getReferenceByUrl($url, $locale)
    {
        // Find the ref id for an url/locale
        $refId = $this->repository->findRefIdByUrl($url, $locale);
        if (!$refId) {
            return;
        }
        // Get the reference
        $ref = $this->repository->findById($refId);
        // Transform the reference into a viewReference
        $transformer = $this->transformer->getViewReferenceTransformer(
            (string) $ref['viewNamespace'], 'array'
        );

        return $transformer->transform($ref);
    }
816636
public function getInitialPath($absolute = false)
    {
        $path = $this->module->getSettings('file_manager', 'initial_path');
        return $absolute ? gplcart_file_absolute($path) : $path;
    }
19851
protected function getUrlAction($options)
    {
        if (is_array($options)) {
            return $this->url->to($options[0], array_slice($options, 1));
        }

        return $this->url->to($options);
    }
1036039
protected function absoluteUrl()
    {
        if (! Str::startsWith($this->url, ['http', 'https'])) {
            return URL::to($this->url);
        }

        return $this->url;
    }
387460
public function getBasePath() : string
    {
        $baseUri = $this->getBase();
        $path = ltrim($this->getPath(), "/");

        $absoluteUri = $baseUri . (($path === "") ? "" : "/" . $path);

        return $absoluteUri;
    }
457795
public function generate($name, $parameters = array(), $referenceType = false) {
		//Since Symfony 3 dropped compatibility for booleans
		//and completely swapped the logic, let's provide our own compatibility layer.
		//We only want to touch booleans. Let proper integer-constant calls to go through.
		if ($referenceType === true) {
			$referenceType = UrlGeneratorInterface::ABSOLUTE_URL;
		} else if ($referenceType === false) {
			$referenceType = UrlGeneratorInterface::ABSOLUTE_PATH;
		}

		$route = $this->routes->get($name);
		if ($route instanceof Route) {
			$isRouteLocaleAware = (strpos($route->getPath(), '{locale}') !== false);

			if ($isRouteLocaleAware) {
				if (!array_key_exists('locale', $parameters)) {
					try {
						$parameters['locale'] = $this->getRequest()->getLocale();
					} catch (\RuntimeException $e) {
						//Not running in a request context.
					}
				}
			} else {
				//Route that doesn't take a locale. If one was provided, get rid of it.
				//This is necessary, because we put certain systems into single-locale mode
				//(and transparently remove {locale} from routes.
				//Still, some code passes locales around.. But the routes no longer need it.
				//Instead of fixing all these passers so that they don't pass when in single-locale mode,
				//we do this transparently here.
				//
				//Caveat: If someone uses a non-locale-aware route, but wants a `locale` query string,
				//(`locale` meaning something possibly-unrelated to this library),
				//we would strip it as well and not pass it along.
				//This is a known problem. We take over `locale` and don't let people use it when they
				//include this library.
				unset($parameters['locale']);
			}
		}

		return parent::generate($name, $parameters, $referenceType);
	}
628774
function logicalPath($absolutePath)
    {
        foreach ($this->loadPaths->paths() as $lp) {
            $absoluteLoadPath = realpath($lp);

            if (strpos($absolutePath, $absoluteLoadPath) === 0) {
                return ltrim(substr($absolutePath, strlen($absoluteLoadPath)), '/');
            }
        }
    }
265207
public function checkAction( $action, $parameters = array(), $absolute = true )
  {
    try {
      $url = $this->_app['url']->action($action, $parameters, $absolute);
    } catch( InvalidArgumentException $e ) {
      return false;
    }

    return $url;
  }