X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhttp%2FPhpHttpRequest.php;h=3f3803b41cb6c58b88fb2f22ccb9e2b6de9cdadf;hb=f0c0a46cdb2a6356204d27f90b47abed9af05c0b;hp=2af000fac0d4902b3589ad89c98d07c8f353cce7;hpb=9de4779e206628d8c7c9ae76785bfe825b5267d5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/http/PhpHttpRequest.php b/includes/http/PhpHttpRequest.php index 2af000fac0..3f3803b41c 100644 --- a/includes/http/PhpHttpRequest.php +++ b/includes/http/PhpHttpRequest.php @@ -87,15 +87,20 @@ class PhpHttpRequest extends MWHttpRequest { * is completely useless (something like "fopen: failed to open stream") * so normal methods of handling errors programmatically * like get_last_error() don't work. + * @internal */ public function errorHandler( $errno, $errstr ) { $n = count( $this->fopenErrors ) + 1; $this->fopenErrors += [ "errno$n" => $errno, "errstr$n" => $errstr ]; } + /** + * @see MWHttpRequest::execute + * + * @return Status + */ public function execute() { - - parent::execute(); + $this->prepare(); if ( is_array( $this->postData ) ) { $this->postData = wfArrayToCgi( $this->postData ); @@ -227,12 +232,12 @@ class PhpHttpRequest extends MWHttpRequest { . ': error opening connection: {errstr1}', $this->fopenErrors ); } $this->status->fatal( 'http-request-error' ); - return $this->status; + return Status::wrap( $this->status ); // TODO B/C; move this to callers } if ( $result['timed_out'] ) { $this->status->fatal( 'http-timed-out', $this->url ); - return $this->status; + return Status::wrap( $this->status ); // TODO B/C; move this to callers } // If everything went OK, or we received some error code @@ -253,6 +258,6 @@ class PhpHttpRequest extends MWHttpRequest { } fclose( $fh ); - return $this->status; + return Status::wrap( $this->status ); // TODO B/C; move this to callers } }