From: Tim Starling Date: Sat, 11 Oct 2008 05:20:18 +0000 (+0000) Subject: Revert r41445: static members invite permanent use in the caller, which would give... X-Git-Tag: 1.31.0-rc.0~44799 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=057eb1971f4e549bcb2794aca38943c967d92dc1;p=lhc%2Fweb%2Fwiklou.git Revert r41445: static members invite permanent use in the caller, which would give us an ugly interface to remain backwards compatible with. See CodeReview. --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index b20e3fd880..a31bd9e1a9 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -12,9 +12,6 @@ */ class Http { - public static $lastCurlErrno = 0; - public static $lastHttpResponse = 0; - /** * Simple wrapper for Http::request( 'GET' ) * @see Http::request() @@ -85,16 +82,16 @@ class Http { ob_end_clean(); # Don't return the text of error messages, return false on error - self::$lastHttpResponse = curl_getinfo( $c, CURLINFO_HTTP_CODE ); - if ( self::$lastHttpResponse != 200 ) { - wfDebug( __METHOD__ . ": HTTP return code " . self::$lastHttpResponse . "\n" ); + $retcode = curl_getinfo( $c, CURLINFO_HTTP_CODE ); + if ( $retcode != 200 ) { + wfDebug( __METHOD__ . ": HTTP return code $retcode\n" ); $text = false; } # Don't return truncated output - self::$lastCurlErrno = curl_errno( $c ); - if ( self::$lastCurlErrno != CURLE_OK ) { + $errno = curl_errno( $c ); + if ( $errno != CURLE_OK ) { $errstr = curl_error( $c ); - wfDebug( __METHOD__ . ": CURL error code " . self::$lastCurlErrno . ": $errstr\n" ); + wfDebug( __METHOD__ . ": CURL error code $errno: $errstr\n" ); $text = false; } curl_close( $c );