From 057eb1971f4e549bcb2794aca38943c967d92dc1 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 11 Oct 2008 05:20:18 +0000 Subject: [PATCH] Revert r41445: static members invite permanent use in the caller, which would give us an ugly interface to remain backwards compatible with. See CodeReview. --- includes/HttpFunctions.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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 ); -- 2.20.1