Determine the url to be crawled.

@return null|string

@throws \Exception
165339
protected function getUrlToBeCrawled()
    {
        if (! is_null($this->option('url'))) {
            return $this->option('url');
        }

        if (config('laravel-link-checker.url') != '') {
            return config('laravel-link-checker.url');
        }

        if (config('app.url') != '') {
            return config('app.url');
        }

        throw new Exception('could not determine which url to be crawled.');
    }
51040
public function getPathInfo()
    {
        if ($this->pathInfo == null) {
            if ($this->server->get('PATH_INFO')) {
                $this->pathInfo = $this->server->get('PATH_INFO');
            } else {
                $query = $this->getQueryString();
                $uri = $this->getUri();
                $this->pathInfo = rtrim(str_replace('?'.$query, '', $uri), '/');
            }
        }
        return $this->pathInfo;
    }
1228018
public function getRouteURL()
    {
        if (empty($this->routeUrl)) {
            $param = trim(Server::get('REQUEST_URI'), '/');

            // strip base directory from request url
            $base_dir = $this->getBaseDir();
            $param = substr($param, strlen($base_dir));

            // Strip query string (?a=b) from Request Url
            $path = trim(explode('?', $param)[0], '/');
            $this->routeUrl = strtolower($path);

            if (empty($this->routeUrl)) {
                $this->routeUrl = '/';
            }
        }

        return $this->routeUrl;
    }
680260
public function getPage()
    {
        if (null === $this->site || null === $this->layout || null === $this->title) {
            $this->reset();
            throw new \Exception("Required data missing");
        }

        $page = new Page($this->uid);
        $page->setTitle($this->title);
        $page->setSite($this->site);

        if (null !== $this->parent) {
            $page->setParent($this->insureParentIsSection($this->parent));
        }

        $page->setLayout($this->layout, $this->itemToPushInMainZone);

        if (null !== $this->url) {
            $page->setUrl($this->url);
        }

        if (null !== $this->redirect) {
            $page->setRedirect($this->redirect);
        }

        if (null !== $this->target) {
            $page->setTarget($this->target);
        }

        if (null !== $this->altTitle) {
            $page->setAltTitle($this->altTitle);
        }

        if (null !== $this->state) {
            $page->setState($this->state);
        }

        if (null !== $this->publishedAt) {
            $page->setPublishing($this->publishedAt);
        }

        if (null !== $this->createdAt) {
            $page->setCreated($this->createdAt);
        }

        if (null !== $this->archiving) {
            $page->setArchiving($this->archiving);
        }

        $pageContentSet = $page->getContentSet();
        $this->updateContentRevision($pageContentSet);
        while ($column = $pageContentSet->next()) {
            $this->updateContentRevision($column);
        }

        if (0 < count($this->elements)) {
            foreach ($this->elements as $e) {
                $column = $pageContentSet->item($e['content_set_position']);
                if ($e['set_main_node']) {
                    $e['content']->setMainNode($page);
                }

                $column->push($e['content']);
            }

            $pageContentSet->rewind();
        }

        $this->doPersistIfValid($page);

        $this->reset();

        return $page;
    }
208342
protected function determineRedirectURL()
    {
        $this->redirectURL = trim($this->getRoutedParameter('url'));

        if (empty($this->redirectURL))
        {
            $this->setNotReady("Invalid or missing redirect `url` parameter.", null, 404);
        }
    }
547614
public function getUrl()
    {
        if (is_null($this->_url)) {
            $this->_resourceTypeConfig = $this->getResourceTypeConfig();
            if (is_null($this->_resourceTypeConfig)) {
                $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
                $oErrorHandler =& $connector->getErrorHandler();
                $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
                $this->_url = "";
            }
            else {
                $this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
            }
        }

        return $this->_url;
    }
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;
    }
58063
public function getUrlAttribute()
    {
        if ($this->url === null) {
            $this->url = $this->makeUrl();
        }

        return $this->url;
    }
8878
public function getUri()
    {
        if (null !== $qs = $this->getQueryString()) {
            $qs = '?' . $qs;
        }
        return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getRequest()->getPathInfo() . $qs;
    }
741246
protected function _exception() {
        $url = '.' . $this->request->src . '.' . $this->request->controller . '.' . $this->request->action;

        if (in_array($url, $this->config['user']['security']['spam']['config']['exception'])) {
            $this->_exception = true;
        }

        return $this->_exception;
    }
1279850
public function parseUrl()
    {
        \Cml\Route::parsePathInfo();

        $dispatcher = \FastRoute\simpleDispatcher(function (RouteCollector $r) {
            foreach ($this->routes as $route) {
                $r->addRoute($route['method'], $route['uri'], $route['action']);
            }
        });

        $httpMethod = isset($_POST['_method']) ? strtoupper($_POST['_method']) : strtoupper($_SERVER['REQUEST_METHOD']);
        $routeInfo = $dispatcher->dispatch($httpMethod, implode('/', \Cml\Route::getPathInfo()));

        switch ($routeInfo[0]) {
            case Dispatcher::NOT_FOUND:
            case Dispatcher::METHOD_NOT_ALLOWED:
                break;
            case Dispatcher::FOUND:
                $_GET += $routeInfo[2];
                if (is_callable($routeInfo[1])) {
                    \Cml\Route::executeCallableRoute($routeInfo[1], 'fastRoute');
                }
                $this->parseUrlParams($routeInfo[1]);
                break;
        }

        return $dispatcher;
    }
922344
public function getUrl()
    {
        $query = $this->getQueryString();
        return sprintf('%s://%s/%s/%s%s',
            $this->getScheme(),
            trim($this->getHost(), '/'),
            trim($this->config->getRootEndpoint(), '/'),
            $this->getEntityType(),
            empty($query) ? '' : sprintf('?%s', $query)
        );
    }
370361
public function getCrawler()
    {
        if (null === $this->crawler) {
            @trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
            // throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
        }

        return $this->crawler;
    }
685318
protected function getReturnURL()
    {
        $url = $this->request->getVar('returnURL');

        // Check that this url is a site url
        if (empty($url) || !Director::is_site_url($url)) {
            return null;
        }

        // Convert to absolute URL
        return Director::absoluteURL($url, true);
    }
412421
public function getLinks()
	{
		if ( is_null( $this->getUrlBase() ) )
		{
			trigger_error( 'Pagination getLinks: Is necessary to set URL base for the page link with \'setUrlBase( $url )\' method.' );
			return false;
		}

		if ( is_null( $this->layout_template ) )
		{
			trigger_error( 'Pagination getLinks: Is necessary to set the pagination template for the page link with \'setTemplate( $layout_template )\' method.' );
			return false;
		}

		// Set number of pages to show.
		$this->num_pages = (int)ceil( ( $this->items_total / $this->items_per_page ) );

		// Check for max_page ( for Google ).
		if ( !is_null( $this->max_num_pages ) && $this->num_pages > $this->max_num_pages )
		{
			$this->num_pages = $this->max_num_pages;
		}

		// Throw exception when page is higher than current page.
		if ( $this->current_page_number > $this->num_pages )
		{
			throw new \Sifo\Exception_404( 'Pagination error: trying to retrieve an unexisting page' );
		}

		return $this->getPaginationData();
	}
52606
public static function current()
    {
        if (!is_null(static::$uri)) {
            return static::$uri;
        }

        //Format a given URI.
        $uri = trim(self::$pathInfo, '/') ?: '/';

        //Set the URI segments for the request.
        $segments = explode('/', trim($uri, '/'));
        static::$segments = array_diff($segments, array(''));

        return static::$uri = $uri;
    }
520753
public static function getSiteUrl()
    {
        if (!self::hasServerVariable('HTTP_HOST')) {
            return null;
        }
        
        $protocol = (self::looksLikeHttps()) ? 'https' : 'http';
        $port = self::getServerVariable('SERVER_PORT', 80);
        
        list ($host) = explode(':', self::getServerVariable('HTTP_HOST'));
        
        if (!in_array($port, [
            80,
            443
        ]) || ($protocol != 'https' && $port == 443)) {
            $host .= ':' . $port;
        }
        
        $fullUrl = $protocol . '://' . $host . '/';
        if (USE_INDEX_FILE) {
            $fullUrl .= 'index.php/';
        }
        
        return $fullUrl;
    }