From: Mark A. Hershberger Date: Wed, 20 Oct 2010 02:50:36 +0000 (+0000) Subject: follow up r75046 — Add getStatus() method to HttpRequest X-Git-Tag: 1.31.0-rc.0~34406 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=1a2b825f45bde593b74c659f837e6da05095727c;p=lhc%2Fweb%2Fwiklou.git follow up r75046 — Add getStatus() method to HttpRequest --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 0dccebbd97..5ba2b8db19 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -402,6 +402,19 @@ class HttpRequest { } } + /** + * Get the member variable status for an HTTP Request + * + * @return Integer + */ + public function getStatus() { + if ( !$this->respHeaders ) { + $this->parseHeader(); + } + + return (int)$this->respStatus; + } + /** * Returns true if the last status code was a redirect.