summaryrefslogtreecommitdiff
path: root/includes/WebResponse.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /includes/WebResponse.php
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'includes/WebResponse.php')
-rw-r--r--includes/WebResponse.php30
1 files changed, 29 insertions, 1 deletions
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