X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWebResponse.php;h=1b6947cd961c4a09177f1fb0e7d62e13515d7956;hb=1996e35ec7d4f1453162d3f1bdf5991448d9e968;hp=ab34931c2c2c4967876b4c90694d3e4517c480a4;hpb=f9a5c177994f81b3e12cc47a0f9f7c0ddf66bcdc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebResponse.php b/includes/WebResponse.php index ab34931c2c..1b6947cd96 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. @@ -53,6 +53,15 @@ class WebResponse { return null; } + /** + * 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. @@ -162,6 +171,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.