Given the object's current settings, make a request to the supplied url
using PHP's native, less speedy, fopen functions
@param string $url The url to make the request to
@return string The full HTTP response
488638
protected function _makeFOpenRequest($url)
    {
        $context      = $this->_buildFOpenStreamContext();
        $file_pointer = @fopen($url, 'r', null, $context);

        if(!$file_pointer)
            throw new Exception("There was an error making the request. Make sure that the url is valid, and either fopen or cURL are available.");

        $meta    = stream_get_meta_data($file_pointer);
        $headers = $this->_buildResponseHeaderFromMeta($meta);
        $content = stream_get_contents($file_pointer);

        fclose($file_pointer);

        return "$headers\r\n\r\n$content";
    }
1337000
public function shorten($url)
    {
        // make the API call through the extended client
        $response = $this->fetchUrl($this->url(), $this->parameters($url));

        // read the shorted url from the response object
        $shorter_url = $this->parse($response);

        return $shorter_url;
    }
1004014
protected function createUri($url)
	{
		if ($url instanceof Uri)
		{
			return $url;
		}

		// Create full URL if we are only appending variables to it
		if (substr($url, 0, 1) == '&')
		{
			$vars = array();

			if (strpos($url, '&amp;') !== false)
			{
				$url = str_replace('&amp;', '&', $url);
			}

			parse_str($url, $vars);

			$vars = array_merge($this->vars(), $vars);

			foreach ($vars as $key => $var)
			{
				if ($var == '')
				{
					unset($vars[$key]);
				}
			}

			$url = 'index.php?' . urldecode(http_build_query($vars, '', '&'));
		}

		return new Uri($url);
	}
382381
private function retrieveContentFromUrl($url)
    {
        $ctx = $this->prepareContext($url);

        $body = file_get_contents($url, 0, $ctx);

        if (isset($http_response_header)) {
            $code = substr($http_response_header[0], 9, 3);
            if (floor($code / 100) > 3) {
                throw new \Exception($http_response_header[0]);
            }
        } else {
            throw new \Exception('Request failed.');
        }

        return $body;
    }
1170937
private function processURL($url) {

        // Clean up special characters in url params
        $url = str_replace("%20", " ", $url);

        // Store a private copy for use later
        $this->url = URLHelper::$testURL == null ? $url : URLHelper::$testURL;

        // Split it on protocol first if required.
        if (substr($url, 0, 4) == "http") {
            $splitProtocol = explode("://", $url);
            $requestSection = sizeof($splitProtocol) > 1 ? $splitProtocol [1] : $splitProtocol [0];
            $requestSection = substr($requestSection, strpos($requestSection, "/"));
        } else {
            $requestSection = $url;
        }
        $this->requestURI = $requestSection;

        // Now split it on question mark for query if required.
        $splitQuestionMark = explode("?", $requestSection);
        $queryStripped = $splitQuestionMark [0];

        // Now ensure no trailing or leading slash.
        if (substr($queryStripped, 0, 1) == '/') $queryStripped = substr($queryStripped, 1);
        if (substr($queryStripped, strlen($queryStripped) - 1) == '/') $queryStripped = substr($queryStripped, 0, strlen($queryStripped) - 1);

        // Now simply set the segments array to be the split on "/"
        $this->segments = explode("/", $queryStripped);

    }
1370762
protected function _makeCurlRequest($url)
    {
        $curl_handle = curl_init($url);

        curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, $this->_requestMethod);
        if($this->_requestBody)
        {
            curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->_requestBody);
        }

        curl_setopt($curl_handle, CURLOPT_HEADER, true);
        curl_setopt($curl_handle, CURLOPT_USERAGENT, $this->_requestUserAgent);
        curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl_handle, CURLOPT_COOKIE, $this->_buildProxyRequestCookieString());
        curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $this->_generateProxyRequestHeaders());

        $response = curl_exec($curl_handle);

        if (false === $response) {
            var_dump(curl_error($curl_handle));
        } else {
            return $response;
        }
    }
1273399
public function get( $url ) {
		$this->assertString( 'url', $url );

		if ( !isset( $this->conn ) ) {
			$this->connect();
		}

		$this->setCurlGetOpts( $url );

		return $this->request();
	}
409080
public static function resolve_url($url)
    {
        // prepend protocol://hostname:port
        if (!preg_match('|^https?://|', $url)) {
            $schema       = 'http';
            $default_port = 80;

            if (self::https_check()) {
                $schema       = 'https';
                $default_port = 443;
            }

            $prefix = $schema . '://' . preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST']);
            if ($_SERVER['SERVER_PORT'] != $default_port) {
                $prefix .= ':' . $_SERVER['SERVER_PORT'];
            }

            $url = $prefix . ($url[0] == '/' ? '' : '/') . $url;
        }

        return $url;
    }
1091628
public function prepUrl($url)
	{
        if (empty($url)) {
            return '';
        }

        return parse_url($url, PHP_URL_SCHEME) === null ? 'http://' . $url : $url;
	}
657345
public function get(string $url): string
    {
        $ch = curl_init($url);

        if ( ! ini_get('open_basedir')) {
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        }

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_VERBOSE, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36');
        curl_setopt($ch, CURLOPT_URL, $url);

        $content = curl_exec($ch);
        if ($content === false) {
            // there was a problem
            $error = curl_error($ch);
            throw new CurlException('Error retrieving "'.$url.'" ('.$error.')');
        }

        return $content;
    }
475216
public function generateUrl($url)
    {
        $extern = false;
        if ((0 === strrpos($url, 'http://'))
            || (0 === strrpos($url, 'https://'))) {
            $extern = true;
        }

        $http = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';

        if (!$extern) {
            return ($this->getRoot() == '/')
                ? (($this->getRoot() == $url) ? '' : $url) : $http.$_SERVER['SERVER_NAME'].$this->getRoot().$url;
        } else {
            return $url;
        }
    }
304042
private function get($url)
    {
        try {
            $result = $this->fileHelper->getContents(
                $url,
                $this->config->get('concrete.marektplace.request_timeout'));
        } catch (TimeoutException $e) {
            // Catch a timeout
            $this->connectionError = self::E_CONNECTION_TIMEOUT;

            return null;
        } catch (Exception $e) {
            $this->connectionError = self::E_GENERAL_CONNECTION_ERROR;

            return null;
        }

        return $result ?: null;
    }
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;
    }
1116322
protected function getResponse(string $url):ResponseInterface {
		curl_setopt($this->curl, CURLOPT_URL, $url);

		return new Response($this->curl);
	}
300628
protected function request($url)
	{
		$response = null;
		try {
			$response = $this->getHttpClient()
				->get($url)
				->send();
		} catch (ClientErrorResponseException $e) {
			return Json::encode([
				'error' => $e->getMessage()
			]);
		}

		return $response->json();
	}
1269459
public function httpGetRequest($url)
    {
        // create curl resource
        $curl = curl_init();

        // set url
        curl_setopt($curl, CURLOPT_URL, $url);

        //return the transfer as a string
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

        // $output contains the output string
        $response = curl_exec($curl);

        $resolve = $this->curlResponse->resolve($curl, $response);

        curl_close($curl);

        return $resolve;
    }
158494
private function curlRequest($url)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_COOKIESESSION, true);
        $data = curl_exec($curl);
        $info = curl_getinfo($curl);
        curl_close($curl);

        if (200 !== $info['http_code']) {
            throw new HttpException($info['http_code']);
        }

        return json_decode($data, true);
    }