Ensure the URL is set, return default otherwise
@return string
166982
public static function getUrl($url = false)
    {
        $url = false !== $url ? $url : self::$_url;
        return $url;
    }
135213
public function url() {
        $this->check_role = 'url';
        $result = $this->filter($this->value, FILTER_VALIDATE_URL);
        $this->checkResult($result);
        return $this;
    }
50227
public static function url()
    {
        if (! isset(self::$_url)) {
            $url = self::scheme().'://';

            if (PHP_SAPI !== 'cli') {
                /*
            	 * Since we are assigning the URI from the server variables, we first need
             	 * to determine if we are running on apache or IIS.  If PHP_SELF and REQUEST_URI
             	 * are present, we will assume we are running on apache.
             	 */
                if (! empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {
                    /*
                 	 * To build the entire URI we need to prepend the protocol, and the http host
                 	 * to the URI string.
                 	 */
                    $url .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

                    /*
                 	 * Since we do not have REQUEST_URI to work with, we will assume we are
                 	 * running on IIS and will therefore need to work some magic with the SCRIPT_NAME and
                 	 * QUERY_STRING environment variables.
                 	 */
                } else {
                    // IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable
                    $url .= $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];

                    // If the query string exists append it to the URI string
                    if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
                        $url .= '?' . $_SERVER['QUERY_STRING'];
                    }
                }
            } else {
                $url .= 'anahita';
            }

            // Sanitize the url since we can't trust the server var
            $url = AnService::get('anahita:filter.url')->sanitize($url);

            // Create the URI object
            self::$_url = AnService::get('anahita:http.url', array('url' => $url));
        }

        return self::$_url;
    }
293630
public static function URI(){
    switch(true){
      case !empty($_SERVER['REQUEST_URI']):    $serv_uri = $_SERVER['REQUEST_URI']; break;
      case !empty($_SERVER['ORIG_PATH_INFO']): $serv_uri = $_SERVER['ORIG_PATH_INFO']; break;
      case !empty($_SERVER['PATH_INFO']):      $serv_uri = $_SERVER['PATH_INFO']; break;
      default:                                 $serv_uri = '/'; break;
    }
    $uri = rtrim(strtok($serv_uri,'?'),'/') ?: '/';
    return Filter::with('core.request.URI', $uri) ?: '/';
  }
102028
protected function buildCompatibleUrl()
    {
        $url             = $this->url;
        $parametersIndex = stripos($url, "?");
        if (!is_int($parametersIndex) || $parametersIndex < 0) {
            $url .= "?";
        } else {
            $url .= "&";
        }
        return $url;
    }
552300
public function get_default(): ?string
  {
    if (
      ($id_opt = $this->from_path('default')) &&
      ($all = $this->pref->get_all($id_opt))
    ){
      $id = false;
      foreach ( $all as $a ){
        if ( !empty($a['id_user']) ){
          $id = $a['id_alias'];
          break;
        }
        else if ( !empty($a['id_group']) ){
          $id = $a['id_alias'];
          break;
        }
        else if ( !empty($a['public']) ){
          $id = $a['id_alias'];
          break;
        }
      }
      return $id;
    }
	return null;
  }
1036039
protected function absoluteUrl()
    {
        if (! Str::startsWith($this->url, ['http', 'https'])) {
            return URL::to($this->url);
        }

        return $this->url;
    }
981263
protected function default()
    {
        $current_value = fp_env('ACACHA_FORGE_SITE');
        if ($current_value) {
            $site_name = $this->getSiteName($this->sites, $current_value);
            if ($site_name) {
                return $site_name;
            }
        }
        return fp_env('ACACHA_FORGE_DOMAIN');
    }
930513
public function getDefaultUrl(): string
    {
        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages');
        $firstPageInTree = $connection->select(['uid'], 'pages', ['pid' => 0], [], ['sorting' => 'ASC'], 1)->fetchColumn(0);
        $url = BackendUtility::getViewDomain($firstPageInTree);

        return $url;
    }
1168528
public function getUrl()
    {
        // Ensure in request cycle (even for override).
        if ($this->request === null) {
            return null;
        }

        // Ensure request has been matched
        if (!$this->request->attributes->get('_route')) {
            return null;
        }

        if ($this->override) {
            $this->resolveCurrentOverride();

            return (string) $this->override;
        }

        return $this->urlGenerator->generate(
            $this->request->attributes->get('_route'),
            $this->request->attributes->get('_route_params'),
            UrlGeneratorInterface::ABSOLUTE_URL
        );
    }
1294331
private static function guessAbsoluteURL () {
        $scheme = 'http';
        $host = 'localhost';

        if (isset($_SERVER['REQUEST_SCHEME'])) {
            $scheme = $_SERVER['REQUEST_SCHEME'];
        }

        if (isset($_SERVER['HTTP_HOST'])) {
            $host = $_SERVER['HTTP_HOST'];
        }

        return $scheme . '://' . $host . '/';
    }
1301817
protected function _default()
    {
        $this->url           = NULL;
        $this->data          = NULL;
        $this->sslVerifyPeer = false;
    }
1126055
public function url() {
        if (!$this->url) {

            if (isset($_SERVER[ 'HTTP_X_REWRITE_URL' ])) {
                $this->url = $_SERVER[ 'HTTP_X_REWRITE_URL' ];
            } elseif (isset($_SERVER[ 'REQUEST_URI' ])) {
                $this->url = $_SERVER[ 'REQUEST_URI' ];
            } elseif (isset($_SERVER[ 'ORIG_PATH_INFO' ])) {
                $this->url = $_SERVER[ 'ORIG_PATH_INFO' ] . (!empty($_SERVER[ 'QUERY_STRING' ]) ? '?' . $_SERVER[ 'QUERY_STRING' ] : '');
            } else {
                $this->url = '';
            }

        }

        return $this->url;
    }
623192
public function getUrl()
    {
        if (!$this->isSortable()) {
            return '';
        }

        $params = ['sort_key' => $this->key];

        if ($this->isSortKey()) {
            $params['sort_order'] = $this->request->input('sort_order') == 'desc' ? 'asc' : 'desc';
        }

        return '?'.http_build_query($params + $this->request->all());
    }
779165
public function urlExtension()
    {
        if ($this->home()) {
            return '';
        }

        // if not set in the page get the value from system config
        if (null === $this->url_extension) {
            $this->url_extension = Grav::instance()['config']->get('system.pages.append_url_extension', '');
        }

        return $this->url_extension;
    }
148662
protected function getDefault()
    {
        $current_url = $this->url->get();

        return array(
            'id' => uniqid(),
            'status' => true,
            'title' => '',
            'url' => '',
            'total' => 0,
            'errors' => 0,
            'done' => 0,
            'inserted' => 0,
            'updated' => 0,
            'context' => array(
                'offset' => 0,
                'line' => 1,
            ),
            'data' => array(),
            'message' => array(
                'start' => $this->translation->text('Starting...'),
                'finish' => $this->translation->text('Finished'),
                'process' => $this->translation->text('Processing...')
            ),
            'redirect' => array(
                'finish' => $current_url,
                'errors' => $current_url,
                'no_results' => $current_url
            ),
            'redirect_message' => array(
                'finish' => '',
                'errors' => '',
                'no_results' => ''
            ),
            'log' => array(
                'errors' => ''
            )
        );
    }
551587
public static function setAdminUrl()
    {
        $shopUrl = self::$config['ShopUrl'];

        //Remove https:// and trailing slash (if provided)
        $shopUrl = preg_replace('#^https?://|/$#', '', $shopUrl);

        if(isset(self::$config['ApiKey']) && isset(self::$config['Password'])) {
            $apiKey = self::$config['ApiKey'];
            $apiPassword = self::$config['Password'];
            $adminUrl = "https://$apiKey:$apiPassword@$shopUrl/admin/";
        } else {
            $adminUrl = "https://$shopUrl/admin/";
        }

        self::$config['AdminUrl'] = $adminUrl;

        return $adminUrl;
    }