From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/WebResponse.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'includes/WebResponse.php') diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 09d37385..f7d57e41 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -6,7 +6,7 @@ */ class WebResponse { - /** + /** * Output a HTTP header, wrapper for PHP's * header() * @param $string String: header to output @@ -58,3 +58,31 @@ class WebResponse { } } } + + +class FauxResponse extends WebResponse { + private $headers; + private $cookies; + + public function header($string, $replace=true) { + list($key, $val) = explode(":", $string, 2); + + if($replace || !isset($this->headers[$key])) { + $this->headers[$key] = $val; + } + } + + public function getheader($key) { + return $this->headers[$key]; + } + + public function setcookie( $name, $value, $expire = 0 ) { + $this->cookies[$name] = $value; + } + + public function getcookie( $name ) { + if ( isset($this->cookies[$name]) ) { + return $this->cookies[$name]; + } + } +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf