follow up r75046 — Add getStatus() method to HttpRequest
authorMark A. Hershberger <mah@users.mediawiki.org>
Wed, 20 Oct 2010 02:50:36 +0000 (02:50 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Wed, 20 Oct 2010 02:50:36 +0000 (02:50 +0000)
includes/HttpFunctions.php

index 0dccebb..5ba2b8d 100644 (file)
@@ -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.