Load data from url and pass it to the parser
If successful save raw data to cache.

@param string $url

@return bool
186018
protected function loadFromUrl($url)
    {
        $url = $this->overrideUrl($url);
        $this->log->debug("Load from url $url");
        $this->initCurl();
        curl_setopt($this->curl, CURLOPT_URL, $url);
        if (!$data = $this->getDataFromCurl()) {
            return false;
        }

        // fix encoding
        $data = iconv('ISO-8859-15', 'UTF-8', $data);

        // validate data through parser
        if (!$this->isDataValid($data)) {
            $this->addError($url, 'Data not valid according to parser');

            return false;
        }

        // save result to disk
        $this->saveToCache($data);

        return true;
    }
54738
public static function get( $url ) {
		$cache = get_transient( static::_get_meta_key( $url ) );
		$cache = ! $cache || ! is_array( $cache ) ? [] : $cache;
		return $cache;
	}
989552
protected function parseURL($url)
    {
        $parsed = parse_url($url);
        if ($parsed === false) {
            return false;
        } elseif (!isset($parsed['scheme']) || !$this->isValidScheme($parsed['scheme'])) {
            return false;
        } else {
            if (!isset($parsed['host']) || !$this->isValidHostName($parsed['host'])) {
                return false;
            } else {
                if (!isset($parsed['port'])) {
                    $parsed['port'] = getservbyname($parsed['scheme'], 'tcp');
                    if (!is_int($parsed['port'])) {
                        return false;
                    }
                }
            }
        }
        $parsed['custom'] = (isset($parsed['path']) ? $parsed['path'] : '/') . (isset($parsed['query']) ? '?' . $parsed['query'] : '');
        return $parsed;
    }
1095959
public function load( string $hash )
	{
		return $this->isCached($hash)
			? $this->cache[$hash]['data']
			: false;
	}
1061603
public function parse($url)
    {
        $content = $this->performRequest($url)->getBody()->getContents();

        $content = $this->convertEncodingToUTF8($content);

        return $this->getHtmlDomParser($content);
    }
247665
public function performRequest($url)
    {
        $client = $this->getClient();

        return $this->response = $client->get($url);
    }
1012090
private function getFile($url)
	{
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_HEADER, false);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
		$result = curl_exec($ch);
		curl_close($ch);

		$response = json_decode($result, TRUE);
		if (is_array($response) && count($response) > 0 && (!isset($response['status']) || $response['status'] != '404')) {
			return $response;
		}
		
		return false;
	}
514654
protected static function parseUrl($url)
    {
        $url_parts = Utils::multibyteParseUrl($url);

        if (isset($url_parts['scheme'])) {
            /** @var UniformResourceLocator $locator */
            $locator = Grav::instance()['locator'];

            // Special handling for the streams.
            if ($locator->schemeExists($url_parts['scheme'])) {
                if (isset($url_parts['host'])) {
                    // Merge host and path into a path.
                    $url_parts['path'] = $url_parts['host'] . (isset($url_parts['path']) ? '/' . $url_parts['path'] : '');
                    unset($url_parts['host']);
                }

                $url_parts['stream'] = true;
            }
        }

        return $url_parts;
    }
685075
public function match($url)
    {
        if ($this->isString($url)) {
            $url = $this->url($url);
        } else {
            $url = StdObjectWrapper::isUrlObject($url) ? $url : $this->url('');
        }

        // get it from cache
        if (($result = $this->loadFromCache('match.' . $url->val())) !== false) {
            return $this->unserialize($result);
        }

        // try to match the url
        $result = $this->urlMatcher->match($url);

        // cache it
        $cacheResult = $this->isArray($result) ? $this->serialize($result) : $result;
        $this->saveToCache('match.' . $url->val(), $cacheResult);

        return $result;
    }
1140155
public function fetch($url)
    {
        if ($this->cache && $this->cache->contains($url)) {
            return $this->cache->fetch($url);
        } else {
            $result = $this->doFetch($url);

            if ($this->cache && $result) {
                $this->cache->save($url, $result);
            }

            return $result;
        }
    }
1088690
public function isWebpage($url) {
		$url = filter_var($url, FILTER_VALIDATE_URL);
		if (!strlen($url)) {
			return false;
		}
		
		$c = curl_init(); 
		curl_setopt($c, CURLOPT_URL, $url); 
		curl_setopt($c, CURLOPT_HEADER, 1); // get the header 
		curl_setopt($c, CURLOPT_NOBODY, 1); // and *only* get the header 
		curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); // get the response as a string from curl_exec(), rather than echoing it 
		curl_setopt($c, CURLOPT_FRESH_CONNECT, 1); // don't use a cached version of the url 
		$result = curl_exec($c);
		
		if (!$result) { 
			return false; 
		} 
		
		if (stripos($result, 'Content-type: text/html')) {
//			$svc = new RestfulService($url);
//			$response = $svc->request('', 'GET');
			return true;
		}
		
		return false;
	}
1037414
public function tokenizeUrl($url)
	{
		if(!is_file($url))
		{
			throw new \RuntimeException(sprintf('URL does not point to a valid file: "%s"', $url));
		}
		
		$source = @file_get_contents($url);
		
		if($source === false)
		{
			// @codeCoverageIgnoreStart
			throw new \RuntimeException(sprintf('Unable to tokenize contents loaded from: "%s"', $url));
			// @codeCoverageIgnoreEnd
		}
		
		return $this->tokenize($source);
	}
300159
private function fetchSerpContent($url)
    {
        $file = FileSystemHelper::getCachedEntry($url, $this->getCacheDir());
        // check if we have a cache entry
        if ($this->cacheHit($url)) {
            return file_get_contents($file);
        }
        // fetch content
        $content = file_get_contents($url, self::SHD_USE_INCLUDE_PATH,
                                     self::SHD_CONTEXT, self::SHD_OFFSET);
        // add cache signature
        $content .= '<!-- cached: ' . time() . ' -->';
        file_put_contents($file, $content);
        // encode the string properly
        return utf8_encode($content);
    }
840837
protected function parse($url)
    {
        $html = $this->get($url)->getBody()->getContents();

        $parser = $this->getParser($html);

        return $parser;
    }
264538
protected static function parseUrl($url)
    {
        $url           = isset($url) ? $url : "//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
        $url           = parse_url($url);
        $url['browse'] = './';
        if (array_key_exists('browse', self::$requestMethod)
            && !empty(self::$requestMethod['browse'])
        ) {
            $url['browse'] = self::$requestMethod['browse'];
        }
        return $url;
    }
908712
public function httpGetRequest($url)
    {
        // Check for cache hit.
        if ($this->useCache()) {
            $cache = $this->getCache();

            if ($response = $cache->get($url)) {
                return $response;
            }
        }

        if (empty($this->client)) {
            $this->client = new Client(['verify' => false]);
        }

        $this->response = $this->client->request(
            'GET',
            $url,
            ['headers' => $this->getHeaders()]
        );
        $response = json_decode($this->response->getBody());

        if (!empty($cache)) {
            $cache->put($url, $response, $this->getCacheTtl());
        }

        return $response;
    }
407541
function load($url) {
            if (empty($url)) return false;
            $this->parseXML(implode('', @file($url)));
        }