@@ -65,7 +65,7 @@ class FacebookCurlHttpClient implements FacebookHttpable
6565 /**
6666 * @var FacebookCurl Procedural curl as object
6767 */
68- protected static $ facebookCurl ;
68+ protected $ facebookCurl ;
6969
7070 /**
7171 * @var boolean If IPv6 should be disabled
@@ -87,14 +87,14 @@ class FacebookCurlHttpClient implements FacebookHttpable
8787 */
8888 public function __construct (FacebookCurl $ facebookCurl = null )
8989 {
90- self :: $ facebookCurl = $ facebookCurl ?: new FacebookCurl ();
90+ $ this -> facebookCurl = $ facebookCurl ?: new FacebookCurl ();
9191 self ::$ disableIPv6 = self ::$ disableIPv6 ?: false ;
9292 }
9393
9494 /**
9595 * Disable IPv6 resolution
9696 */
97- public function disableIPv6 ()
97+ public static function disableIPv6 ()
9898 {
9999 self ::$ disableIPv6 = true ;
100100 }
@@ -195,16 +195,16 @@ public function openConnection($url, $method = 'GET', $parameters = array())
195195 $ options [CURLOPT_IPRESOLVE ] = CURL_IPRESOLVE_V4 ;
196196 }
197197
198- self :: $ facebookCurl ->init ();
199- self :: $ facebookCurl ->setopt_array ($ options );
198+ $ this -> facebookCurl ->init ();
199+ $ this -> facebookCurl ->setopt_array ($ options );
200200 }
201201
202202 /**
203203 * Closes an existing curl connection
204204 */
205205 public function closeConnection ()
206206 {
207- self :: $ facebookCurl ->close ();
207+ $ this -> facebookCurl ->close ();
208208 }
209209
210210 /**
@@ -213,17 +213,17 @@ public function closeConnection()
213213 public function tryToSendRequest ()
214214 {
215215 $ 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 );
219219 }
220220
221221 /**
222222 * Send the request and get the raw response from curl
223223 */
224224 public function sendRequest ()
225225 {
226- $ this ->rawResponse = self :: $ facebookCurl ->exec ();
226+ $ this ->rawResponse = $ this -> facebookCurl ->exec ();
227227 }
228228
229229 /**
@@ -297,10 +297,10 @@ public static function headersToArray($rawHeaders)
297297 */
298298 private function getHeaderSize ()
299299 {
300- $ headerSize = self :: $ facebookCurl ->getinfo (CURLINFO_HEADER_SIZE );
300+ $ headerSize = $ this -> facebookCurl ->getinfo (CURLINFO_HEADER_SIZE );
301301 // This corrects a Curl bug where header size does not account
302302 // for additional Proxy headers.
303- if ( self :: needsCurlProxyFix () ) {
303+ if ( $ this -> needsCurlProxyFix () ) {
304304 // Additional way to calculate the request body size.
305305 if (preg_match ('/Content-Length: (\d+)/ ' , $ this ->rawResponse , $ m )) {
306306 $ headerSize = mb_strlen ($ this ->rawResponse ) - $ m [1 ];
@@ -318,9 +318,9 @@ private function getHeaderSize()
318318 *
319319 * @return boolean
320320 */
321- private static function needsCurlProxyFix ()
321+ private function needsCurlProxyFix ()
322322 {
323- $ ver = self :: $ facebookCurl ->version ();
323+ $ ver = $ this -> facebookCurl ->version ();
324324 $ version = $ ver ['version_number ' ];
325325
326326 return $ version < self ::CURL_PROXY_QUIRK_VER ;
0 commit comments