summaryrefslogtreecommitdiff
path: root/includes/WebResponse.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
commita2190ac74dd4d7080b12bab90e552d7aa81209ef (patch)
tree8b31f38de9882d18df54cf8d9e0de74167a094eb /includes/WebResponse.php
parent15e69f7b20b6596b9148030acce5b59993b95a45 (diff)
parent257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff)
Merge branch 'mw-1.26'
Diffstat (limited to 'includes/WebResponse.php')
-rw-r--r--includes/WebResponse.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/includes/WebResponse.php b/includes/WebResponse.php
index ab34931c..1b6947cd 100644
--- a/includes/WebResponse.php
+++ b/includes/WebResponse.php
@@ -28,7 +28,7 @@
class WebResponse {
/**
- * Output a HTTP header, wrapper for PHP's header()
+ * Output an HTTP header, wrapper for PHP's header()
* @param string $string Header to output
* @param bool $replace Replace current similar header
* @param null|int $http_response_code Forces the HTTP response code to the specified value.
@@ -54,6 +54,15 @@ class WebResponse {
}
/**
+ * Output an HTTP status code header
+ * @since 1.26
+ * @param int $code Status code
+ */
+ public function statusHeader( $code ) {
+ HttpStatus::header( $code );
+ }
+
+ /**
* Set the browser cookie
* @param string $name The name of the cookie.
* @param string $value The value to be stored in the cookie.
@@ -163,6 +172,14 @@ class FauxResponse extends WebResponse {
}
/**
+ * @since 1.26
+ * @param int $code Status code
+ */
+ public function statusHeader( $code ) {
+ $this->code = intval( $code );
+ }
+
+ /**
* @param string $key The name of the header to get (case insensitive).
* @return string|null The header value (if set); null otherwise.
*/