diff options
author | Mark A. Hershberger <mah@users.mediawiki.org> | 2010-02-10 10:36:11 +0000 |
---|---|---|
committer | Mark A. Hershberger <mah@users.mediawiki.org> | 2010-02-10 10:36:11 +0000 |
commit | c74fe71cd8ead6f9daa96e5e5da9da1fc2f8c02a (patch) | |
tree | bfe699c929742308a82c94cb9ad9f53f9539fc6e /includes/WebResponse.php | |
parent | c386434108427200ea3982453d1c015cc3af2036 (diff) | |
download | mediawikicore-c74fe71cd8ead6f9daa96e5e5da9da1fc2f8c02a.tar.gz mediawikicore-c74fe71cd8ead6f9daa96e5e5da9da1fc2f8c02a.zip |
* new FauxResponse class to help with unit testing
* Add append() method to FileRepo classes to enable chunked uploading
* Change chunksessionkey to chunksession
* Remove echo json stuff
* Fix a multitude of bugs in my own code
* still to test: mwEmbed use of chunked upload
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/62231
Diffstat (limited to 'includes/WebResponse.php')
-rw-r--r-- | includes/WebResponse.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 09d373850fc7..f7d57e41c1f3 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 |