@@ -65,7 +65,7 @@ class FacebookCurlHttpClient implements FacebookHttpable
65
65
/**
66
66
* @var FacebookCurl Procedural curl as object
67
67
*/
68
- protected static $ facebookCurl ;
68
+ protected $ facebookCurl ;
69
69
70
70
/**
71
71
* @var boolean If IPv6 should be disabled
@@ -87,14 +87,14 @@ class FacebookCurlHttpClient implements FacebookHttpable
87
87
*/
88
88
public function __construct (FacebookCurl $ facebookCurl = null )
89
89
{
90
- self :: $ facebookCurl = $ facebookCurl ?: new FacebookCurl ();
90
+ $ this -> facebookCurl = $ facebookCurl ?: new FacebookCurl ();
91
91
self ::$ disableIPv6 = self ::$ disableIPv6 ?: false ;
92
92
}
93
93
94
94
/**
95
95
* Disable IPv6 resolution
96
96
*/
97
- public function disableIPv6 ()
97
+ public static function disableIPv6 ()
98
98
{
99
99
self ::$ disableIPv6 = true ;
100
100
}
@@ -195,16 +195,16 @@ public function openConnection($url, $method = 'GET', $parameters = array())
195
195
$ options [CURLOPT_IPRESOLVE ] = CURL_IPRESOLVE_V4 ;
196
196
}
197
197
198
- self :: $ facebookCurl ->init ();
199
- self :: $ facebookCurl ->setopt_array ($ options );
198
+ $ this -> facebookCurl ->init ();
199
+ $ this -> facebookCurl ->setopt_array ($ options );
200
200
}
201
201
202
202
/**
203
203
* Closes an existing curl connection
204
204
*/
205
205
public function closeConnection ()
206
206
{
207
- self :: $ facebookCurl ->close ();
207
+ $ this -> facebookCurl ->close ();
208
208
}
209
209
210
210
/**
@@ -213,17 +213,17 @@ public function closeConnection()
213
213
public function tryToSendRequest ()
214
214
{
215
215
$ this ->sendRequest ();
216
- $ this ->curlErrorMessage = self :: $ facebookCurl ->error ();
217
- $ this ->curlErrorCode = self :: $ facebookCurl ->errno ();
218
- $ this ->responseHttpStatusCode = self :: $ facebookCurl ->getinfo (CURLINFO_HTTP_CODE );
216
+ $ this ->curlErrorMessage = $ this -> facebookCurl ->error ();
217
+ $ this ->curlErrorCode = $ this -> facebookCurl ->errno ();
218
+ $ this ->responseHttpStatusCode = $ this -> facebookCurl ->getinfo (CURLINFO_HTTP_CODE );
219
219
}
220
220
221
221
/**
222
222
* Send the request and get the raw response from curl
223
223
*/
224
224
public function sendRequest ()
225
225
{
226
- $ this ->rawResponse = self :: $ facebookCurl ->exec ();
226
+ $ this ->rawResponse = $ this -> facebookCurl ->exec ();
227
227
}
228
228
229
229
/**
@@ -297,10 +297,10 @@ public static function headersToArray($rawHeaders)
297
297
*/
298
298
private function getHeaderSize ()
299
299
{
300
- $ headerSize = self :: $ facebookCurl ->getinfo (CURLINFO_HEADER_SIZE );
300
+ $ headerSize = $ this -> facebookCurl ->getinfo (CURLINFO_HEADER_SIZE );
301
301
// This corrects a Curl bug where header size does not account
302
302
// for additional Proxy headers.
303
- if ( self :: needsCurlProxyFix () ) {
303
+ if ( $ this -> needsCurlProxyFix () ) {
304
304
// Additional way to calculate the request body size.
305
305
if (preg_match ('/Content-Length: (\d+)/ ' , $ this ->rawResponse , $ m )) {
306
306
$ headerSize = mb_strlen ($ this ->rawResponse ) - $ m [1 ];
@@ -318,9 +318,9 @@ private function getHeaderSize()
318
318
*
319
319
* @return boolean
320
320
*/
321
- private static function needsCurlProxyFix ()
321
+ private function needsCurlProxyFix ()
322
322
{
323
- $ ver = self :: $ facebookCurl ->version ();
323
+ $ ver = $ this -> facebookCurl ->version ();
324
324
$ version = $ ver ['version_number ' ];
325
325
326
326
return $ version < self ::CURL_PROXY_QUIRK_VER ;
0 commit comments