r41959 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41958‎ | r41959 | r41960 >
Date:05:20, 11 October 2008
Author:tstarling
Status:old
Tags:
Comment:
Revert r41445: static members invite permanent use in the caller, which would give us an ugly interface to remain backwards compatible with. See CodeReview.
Modified paths:
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HttpFunctions.php
@@ -12,9 +12,6 @@
1313 */
1414 class Http {
1515
16 - public static $lastCurlErrno = 0;
17 - public static $lastHttpResponse = 0;
18 -
1916 /**
2017 * Simple wrapper for Http::request( 'GET' )
2118 * @see Http::request()
@@ -85,16 +82,16 @@
8683 ob_end_clean();
8784
8885 # Don't return the text of error messages, return false on error
89 - self::$lastHttpResponse = curl_getinfo( $c, CURLINFO_HTTP_CODE );
90 - if ( self::$lastHttpResponse != 200 ) {
91 - wfDebug( __METHOD__ . ": HTTP return code " . self::$lastHttpResponse . "\n" );
 86+ $retcode = curl_getinfo( $c, CURLINFO_HTTP_CODE );
 87+ if ( $retcode != 200 ) {
 88+ wfDebug( __METHOD__ . ": HTTP return code $retcode\n" );
9289 $text = false;
9390 }
9491 # Don't return truncated output
95 - self::$lastCurlErrno = curl_errno( $c );
96 - if ( self::$lastCurlErrno != CURLE_OK ) {
 92+ $errno = curl_errno( $c );
 93+ if ( $errno != CURLE_OK ) {
9794 $errstr = curl_error( $c );
98 - wfDebug( __METHOD__ . ": CURL error code " . self::$lastCurlErrno . ": $errstr\n" );
 95+ wfDebug( __METHOD__ . ": CURL error code $errno: $errstr\n" );
9996 $text = false;
10097 }
10198 curl_close( $c );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41445Add some more debugging goodies to this. $lastCurlErrno and $lastHttpResponse...demon19:58, 30 September 2008

Status & tagging log