diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 20:21:25 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 20:21:25 +0000 |
commit | d81f562b712f2387fa02290bf2ca86392ab356f2 (patch) | |
tree | d666cdefbe6ac320827a2c6cb473581b46e22c4c /includes/WebRequest.php | |
parent | 183851b06bd6c52f3cae5375f433da720d410447 (diff) |
Aktualisierung auf Version 1.8.1
Diffstat (limited to 'includes/WebRequest.php')
-rw-r--r-- | includes/WebRequest.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 4031e369..32307ed2 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -34,6 +34,15 @@ * * @package MediaWiki */ + +/** + * Some entry points may use this file without first enabling the + * autoloader. + */ +if ( !function_exists( '__autoload' ) ) { + require_once( dirname(__FILE__) . '/normal/UtfNormal.php' ); +} + class WebRequest { function WebRequest() { $this->checkMagicQuotes(); @@ -44,6 +53,8 @@ class WebRequest { substr( $_SERVER['PATH_INFO'], 1 ); } } + + private $_response; /** * Recursively strips slashes from the given array; @@ -117,7 +128,6 @@ class WebRequest { $data = $wgContLang->checkTitleEncoding( $data ); } } - require_once( 'normal/UtfNormal.php' ); $data = $this->normalizeUnicode( $data ); return $data; } else { @@ -437,6 +447,19 @@ class WebRequest { wfDebug( "WebRequest::getFileName() '" . $_FILES[$key]['name'] . "' normalized to '$name'\n" ); return $name; } + + /** + * Return a handle to WebResponse style object, for setting cookies, + * headers and other stuff, for Request being worked on. + */ + function response() { + /* Lazy initialization of response object for this request */ + if (!is_object($this->_response)) { + $this->_response = new WebResponse; + } + return $this->_response; + } + } /** |