Index: trunk/phase3/includes/HttpFunctions.php |
— | — | @@ -12,6 +12,9 @@ |
13 | 13 | */ |
14 | 14 | class Http { |
15 | 15 | |
| 16 | + public static $lastCurlErrno = 0; |
| 17 | + public static $lastHttpResponse = 0; |
| 18 | + |
16 | 19 | /** |
17 | 20 | * Simple wrapper for Http::request( 'GET' ) |
18 | 21 | * @see Http::request() |
— | — | @@ -82,16 +85,16 @@ |
83 | 86 | ob_end_clean(); |
84 | 87 | |
85 | 88 | # Don't return the text of error messages, return false on error |
86 | | - $retcode = curl_getinfo( $c, CURLINFO_HTTP_CODE ); |
87 | | - if ( $retcode != 200 ) { |
88 | | - wfDebug( __METHOD__ . ": HTTP return code $retcode\n" ); |
| 89 | + self::$lastHttpResponse = curl_getinfo( $c, CURLINFO_HTTP_CODE ); |
| 90 | + if ( self::$lastHttpResponse != 200 ) { |
| 91 | + wfDebug( __METHOD__ . ": HTTP return code " . self::$lastHttpResponse . "\n" ); |
89 | 92 | $text = false; |
90 | 93 | } |
91 | 94 | # Don't return truncated output |
92 | | - $errno = curl_errno( $c ); |
93 | | - if ( $errno != CURLE_OK ) { |
| 95 | + self::$lastCurlErrno = curl_errno( $c ); |
| 96 | + if ( self::$lastCurlErrno != CURLE_OK ) { |
94 | 97 | $errstr = curl_error( $c ); |
95 | | - wfDebug( __METHOD__ . ": CURL error code $errno: $errstr\n" ); |
| 98 | + wfDebug( __METHOD__ . ": CURL error code " . self::$lastCurlErrno . ": $errstr\n" ); |
96 | 99 | $text = false; |
97 | 100 | } |
98 | 101 | curl_close( $c ); |