summaryrefslogtreecommitdiff
path: root/includes/WebResponse.php
diff options
context:
space:
mode:
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