Executes a CURL request to the Bitly API
@param  string $url    The URL to send to
@return mixed          The response data
338311
protected function exec($url)
    {
        $client = $this->getRequest();
        $response = $client->request('GET',$url);
        return $this->handleResponse($response->getBody());
    }
113457
private function curl( $url ) {

		$ch	= curl_init();

		curl_setopt( $ch, CURLOPT_URL, $url );
		curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );

		$data = curl_exec( $ch );

		curl_close( $ch );

		return $data;
	}
1326658
public function download($url)
    {
        if (!$this->curl) {
            $this->curl = curl_init();
            curl_setopt($this->curl, CURLOPT_HTTPHEADER, array(
                'User-Agent: gender-api-client/1.0',
                'Content-Type: application/json'
            ));
            curl_setopt($this->curl, CURLOPT_TIMEOUT, 5);
            curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 5);
            curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);

            if ($this->proxyHost) {
                curl_setopt($this->curl, CURLOPT_PROXY, $this->proxyHost);
                curl_setopt($this->curl, CURLOPT_PROXYPORT, $this->proxyPort);
            }
        }

        curl_setopt($this->curl, CURLOPT_URL, $url);

        $response = @curl_exec($this->curl);
        $responseCode = curl_getinfo($this->curl, CURLINFO_RESPONSE_CODE);

        if ($response === false || $responseCode != 200) {
            $lastError = curl_error($this->curl);
            throw new NetworkErrorException($lastError);
        }

        return $response;
    }
1135497
public static function call($url)
    {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);
        curl_setopt($ch, CURLOPT_TIMEOUT, 45);

        $result = curl_exec($ch);

        if (! $result) {
            throw new \Exception(sprintf('The endpoint "%s" is not returning anything.', $url));
        }

        return simplexml_load_string($result);
    }
32774
public function info($url)
    {
        $url = 'http://' . $this->ip . '/' . ltrim($url, '/');
        $options = [
            CURLOPT_URL            => $url,
            CURLOPT_PORT           => $this->port,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_VERBOSE        => WS::config()->get('debug', false)
        ];

        $ch = curl_init();
        curl_setopt_array($ch, $options);
        $response = curl_exec($ch);

        return $this->formatResponse($response);
    }
434941
protected function get($url)
    {
        $request = $this->http->get(
            $url,
            array('User-Agent' => self::USER_AGENT.' v.'.self::VERSION)
        );

        $response = $request->send();

        if (!$response->isSuccessful()) {
            $this->log('fail with '.$response->getStatusCode().' http code in url "'.$url.'" ');

            return;
        }
        $this->logger->log(LogLevel::INFO, 'retrieved url "'.$url.'" ');

        return $response->getBody();
    }
3828
protected function _getCURL($url) {
		curl_setopt($this->_curl, CURLOPT_URL, $url);
		$content = curl_exec($this->_curl);
		return $content;
	}
262044
static function CurlGet($url, $data = "", $verify_cert = false, $timeout = 30)
	{
		return HttpRequest::CurlRequest("GET",$url, $data, $verify_cert, $timeout);
	}
881303
protected function getWebPage($url)
    {
        $curl = curl_init();

        curl_setopt($curl, CURLOPT_URL,            $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_HEADER,         false);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
        $output = curl_exec($curl);
        curl_close($curl);

        return (string) $output;
    }
1339450
private static function curl_get($url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_TIMEOUT, 60);
        curl_setopt($ch, CURLOPT_HEADER, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

        $res      = curl_exec($ch);
        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        $header = '';
        $body   = $res;

        if ($httpcode == 200) {
            list($header, $body) = explode("\r\n\r\n", $res, 2);
            $header = Api::http_parse_headers($header);
        }

        $apiReturnData            = [];
        $apiReturnData['type']    = $header['Content-Type'];
        $apiReturnData['size']    = $header['Content-Length'];
        $apiReturnData['header']  = $header;
        $apiReturnData['content'] = $body;

        return $apiReturnData;
    }
1275167
private function executeQuery(string $url): \stdClass
    {
        $content = $this->getUrlContents($url);
        $json = json_decode($content);
        // API error
        if (!isset($json)) {
            throw InvalidServerResponse::create($url);
        }

        return $json;
    }
480313
public static function get( $url )
	{
		$checksum	= "6".self::calculateChecksum( self::strord( "info:".$url ) );
		$googleUrl	= "www.google.com/search?client=navclient-auto&ch=".$checksum."&features=Rank&q=info:".$url;
		$curl		= new Net_CURL( $googleUrl );
		$response	= $curl->exec();
		$position	= strpos( $response, "Rank_" );
		if( $position === FALSE )
			throw new Exception( 'Response does not contain Rank.' );
		$pagerank = substr( $response, $position + 9 );
		return (int) $pagerank;
	}
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;
    }
1038554
public static function getImageFromUrl($url = '')
    {
        try {
            $curl = new Curl();
            $curl->setOpt(CURLOPT_RETURNTRANSFER, TRUE);
            $curl->setOpt(CURLOPT_ENCODING, "");
            $curl->setOpt(CURLOPT_MAXREDIRS, 10);
            $curl->setOpt(CURLOPT_TIMEOUT, 30);
            $curl->setOpt(CURLOPT_CONNECTTIMEOUT, 30);
            $curl->setOpt(CURLOPT_FOLLOWLOCATION, TRUE);
            $curl->get($url);
            if ($curl->error === TRUE) {
                self::debug('Error Exception: ' . $curl->httpErrorMessage);

                return array(
                    'status'          => 'error',
                    'code'            => $curl->httpStatusCode,
                    'error'           => $curl->errorMessage,
                    'response_header' => $curl->responseHeaders,
                    'content'         => NULL
                );
            } else {
                return array(
                    'status'          => 'success',
                    'code'            => $curl->httpStatusCode,
                    'error'           => $curl->errorMessage,
                    'response_header' => $curl->responseHeaders,
                    'content'         => $curl->response
                );
            }
        }
        catch (\Exception $e) {
            if (function_exists('log_message')) {
                $message = 'Error Code: ' . $e->getCode() . ' - File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Message: ' . $e->getMessage();
                log_message('error', $message);
            }

            return file_get_contents($url);
        }
    }
922113
function curl_get($url) {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
        $json_response = curl_exec($curl);
        $this->last_response = $json_response;
        curl_close($curl);
        return $json_response;
    }
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;
        }
    }
640243
protected function _downloadCurl($url)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        if ($this->sslVerifyHost) {
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
        } else {
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
        }
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->sslVerifyHost);
        $update = curl_exec($curl);

        $error = false;
        if (curl_error($curl)) {
            $error = true;
            $this->log->addError(sprintf(
                'Could not download update "%s" via curl: %s!',
                $url,
                curl_error($curl)
            ));
        }
        curl_close($curl);

        if ($error === true) {
            return false;
        }

        return $update;
    }