Retrieve the data identified by the URL

@param string $url the url of the data
@throws Exception
@return string the retrieved data
488319
protected function _getRemoteData($url)
    {
        ini_set('user_agent', $this->_getUserAgent());

        switch ($this->_getUpdateMethod()) {
            case self::UPDATE_LOCAL:
                $file = file_get_contents($url);

                if ($file !== false) {
                    return $file;
                } else {
                    throw new Exception('Cannot open the local file');
                }
            case self::UPDATE_FOPEN:
                // include proxy settings in the file_get_contents() call
                $context = $this->_getStreamContext();
                $file = file_get_contents($url, false, $context);

                if ($file !== false) {
                    return $file;
                } // else try with the next possibility (break omitted)
            case self::UPDATE_FSOCKOPEN:
                $remote_url = parse_url($url);
                $remote_handler = fsockopen($remote_url['host'], 80, $c, $e, $this->timeout);

                if ($remote_handler) {
                    stream_set_timeout($remote_handler, $this->timeout);

                    if (isset($remote_url['query'])) {
                        $remote_url['path'] .= '?' . $remote_url['query'];
                    }

                    $out = sprintf(
                        self::REQUEST_HEADERS,
                        $remote_url['path'],
                        $remote_url['host'],
                        $this->_getUserAgent()
                    );

                    fwrite($remote_handler, $out);

                    $response = fgets($remote_handler);
                    if (strpos($response, '200 OK') !== false) {
                        $file = '';
                        while (!feof($remote_handler)) {
                            $file .= fgets($remote_handler);
                        }

                        $file = str_replace("\r\n", "\n", $file);
                        $file = explode("\n\n", $file);
                        array_shift($file);

                        $file = implode("\n\n", $file);

                        fclose($remote_handler);

                        return $file;
                    }
                } // else try with the next possibility
            case self::UPDATE_CURL:
                $ch = curl_init($url);

                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);
                curl_setopt($ch, CURLOPT_USERAGENT, $this->_getUserAgent());

                $file = curl_exec($ch);

                curl_close($ch);

                if ($file !== false) {
                    return $file;
                } // else try with the next possibility
            case false:
                throw new Exception('Your server can\'t connect to external resources. Please update the file manually.');
        }
        
        return '';
    }
325720
public function get($url, $data = null)
    {
        if ($this->cache) {
            $result = $this->cache->get($url, array('$data' => $data));
            if (array_key_exists('$data', (array)$result)) {
                return $this->response_data($result, 'get', $url);
            }
        }

        return $this->request('get', $url, $data);
    }
667776
private function http_get($url){
        $oCurl = curl_init();
        if(stripos($url,"https://")!==FALSE){
            curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
            curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE);
            curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); //CURL_SSLVERSION_TLSv1
        }
        curl_setopt($oCurl, CURLOPT_URL, $url);
        curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 );
        $sContent = curl_exec($oCurl);
        $aStatus = curl_getinfo($oCurl);
        curl_close($oCurl);
        if(intval($aStatus["http_code"])==200){
            return $sContent;
        }else{
            return false;
        }
    }
736654
protected static function getUrl($url)
    {
        Craft::debug('Fetching JSON from: '.$url, __METHOD__);

        $ch = curl_init();
        curl_setopt_array(
            $ch,
            [
                CURLOPT_URL => $url,
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_MAXREDIRS => 5,
                CURLOPT_CONNECTTIMEOUT => 5,
            ]
        );
        $data = curl_exec($ch);

        $errorNumber = curl_errno($ch);
        $errorMessage = curl_error($ch);
        curl_close($ch);

        if ($errorNumber > 0) {
            Craft::warning('cURL got an error: '.$errorNumber.', '.$errorMessage, __METHOD__);
            return false;
        }

        return $data;
    }
151701
public static function parse($url)
    {
        $scheme = substr($url, 0, strpos($url, ':'));
        if (strpos($scheme, '+')) {
            $scheme = substr($scheme, 0, strpos($scheme, '+'));
        }

        if (!$scheme) {
            throw new \Exception(sprintf('The url \'%s\' could not be parsed', $url));
        }

        if (isset(static::$schemeMap[$scheme])) {
            $className = static::$schemeMap[$scheme];
        } else {
            $className  = static::currentNamespace() . '\\' . ucfirst($scheme) . 'Dsn';
            if (!class_exists($className)) {
                $className  = static::currentClass();
            }
        }
        return new $className($url);
    }
195392
public function get($url)
    {
        if (isset($this->entries[$url])) {
            return $this->entries[$url];
        } else {
            return null;
        }
    }
658743
function ParseUrl($url) {
	    $content = null;

    	$this->Clear();

		$this->url = htmlspecialchars_decode($url);

	    ob_start();
	    if (function_exists('curl_init')) {
		    //curl is the preferred function
		    $crl = curl_init();
		    curl_setopt($crl, CURLOPT_URL, $url);
		    curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1);
		    curl_setopt($crl, CURLOPT_CONNECTTIMEOUT, 5);
		    curl_setopt($crl, CURLOPT_TIMEOUT, 20);
		    $FileData = curl_exec($crl);
		    $FileInfo = curl_getinfo($crl);
		    curl_close($crl);
		    if ($FileInfo['http_code'] != 200) {
			    throw new \HttpRequestException($FileInfo['http_code'] . ' error for file: ' . $url);
		    }
	    } else {
		    //see if we can use fopen to get file
		    $fopen_check = ini_get('allow_url_fopen');
		    if (!empty($fopen_check)) {
			    $content = file_get_contents($url);
		    } else {
			    throw new \RuntimeException('CURL_DISABLED');
		    }
	    }
	    ob_end_clean();

		if(strlen($content)) {
			$this->modifyContent($content);
			$this->ParseStr($content);
			return true;
		} else {
			return false;
		}
	}
976110
public function loadUrl($url)
    {
        // Fetch HTTP content using Guzzle
        $response = $this->client->get($url);

        return $this->loadHtml($response->getBody()->__toString(), $url);
    }
351278
private function getUrl($url)
	{
		$ch = curl_init();
		curl_setopt($ch,CURLOPT_URL,$url);
		curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
		curl_setopt($ch,CURLOPT_HEADER,0);
		// curl_setopt($ch, CURLOPT_ENCODING, "");
		$output = curl_exec($ch);
		curl_close($ch);
	    return $output;
	}
400087
private static function get(string $url)
    {
        $cu = curl_init();
        curl_setopt_array(
            $cu,
            [
                CURLOPT_URL            => $url,
                CURLOPT_RETURNTRANSFER => 1,
                CURLOPT_FOLLOWLOCATION => 1,
                CURLOPT_USERAGENT      => 'Torrent Parser PHP'
            ]
        );
        $response = curl_exec($cu);
        $data = json_decode($response, true) ?? [];
        return self::createCollection($data);
    }
1052098
public function setUrl(string $url)
    {
        $url = filter_var($url, FILTER_VALIDATE_URL);

        if ($url == false) {
            throw new Exception("Invalid url");
        } else {
            curl_setopt($this->curl, CURLOPT_URL, $url);
        }
    }
247665
public function performRequest($url)
    {
        $client = $this->getClient();

        return $this->response = $client->get($url);
    }
15787
public function loadUrl($url, $curl = false) {
        if ($curl) {
            $content = self::loadContent($url);
            if (empty($content)) {
                throw new Exception("Can't get content from " . $url);
            }
            $this->loadString($content);
        } else {
            $this->load_file($url);
        }
    }
359604
protected function extractUrlParameters($url)
    {
        $query = parse_url($url, PHP_URL_QUERY);
        parse_str($query, $params);

        return $params;
    }
631399
public static function parse($url)
    {
        if (!strlen($url)) {
            return null;
        }
        $_urls = array_merge( @parse_url($url), array('params'=>array()) );
        if (isset($_urls['query'])) {
            parse_str($_urls['query'], $_urls['params']);
        }
        return $_urls;  
    }
503353
public function get($url)
    {
        $ch = curl_init();

        // set URL and other appropriate options
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        // grab URL and pass it to the browser
        $content = curl_exec($ch);
        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        // close cURL resource, and free up system resources
        if ($content === false) {
            throw new \Exception("CurlProxy error: " . curl_error($ch) . " when calling $url");
        }
        curl_close($ch);

        return $http_code == 200 && !empty($content) ? $content : false;
    }
852524
public function retrieveData($url)
    {
        if (!is_null($this->getAuthorizationToken())) {
            $this->curlWrapper->setHeader('Authorization', $this->getAuthorizationToken());
        }

        $this->retrieve($url);

        return $this->curlWrapper->response;
    }