summaryrefslogtreecommitdiffstats
path: root/feed/client/curl.php
diff options
context:
space:
mode:
Diffstat (limited to 'feed/client/curl.php')
-rw-r--r--feed/client/curl.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/feed/client/curl.php b/feed/client/curl.php
index 3cacfe2aa..289faf902 100644
--- a/feed/client/curl.php
+++ b/feed/client/curl.php
@@ -20,6 +20,31 @@ class CURL extends HttpClient {
}
+ public function get ($url) {
+ $curl = curl_init();
+ curl_setopt($curl, CURLOPT_URL, $this->url);
+ curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+ curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->timeout);
+ curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout);
+ curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent);
+ curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers);
+ curl_setopt($curl, CURLOPT_FOLLOWLOCATION, ini_get('open_basedir') === '');
+ curl_setopt($curl, CURLOPT_MAXREDIRS, $this->max_redirects);
+ curl_setopt($curl, CURLOPT_ENCODING, '');
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // For auto-signed certificates...
+ curl_setopt($curl, CURLOPT_WRITEFUNCTION, array($this, 'readBody'));
+ curl_setopt($curl, CURLOPT_HEADERFUNCTION, array($this, 'readHeaders'));
+
+ curl_setopt($curl, CURLOPT_PROXYPORT, $this->proxy_port);
+ curl_setopt($curl, CURLOPT_PROXYTYPE, 'HTTP');
+ curl_setopt($curl, CURLOPT_PROXY, $this->proxy_hostname);
+ curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxy_username.':'.$this->proxy_password);
+
+ curl_errno($curl);
+ curl_error($curl);
+
+ curl_exec($curl);
+ }
}