(bug 22647) Add category details in search results. Contributed by Lejonel.
[lhc/web/wiklou.git] / includes / WebRequest.php
index 6ae71ce..834f2b1 100644 (file)
@@ -624,7 +624,8 @@ class WebRequest {
        public function response() {
                /* Lazy initialization of response object for this request */
                if ( !is_object( $this->_response ) ) {
-                       $this->_response = new WebResponse;
+                       $class = ( $this instanceof FauxRequest ) ? 'FauxResponse' : 'WebResponse';
+                       $this->_response = new $class();
                }
                return $this->_response;
        }
@@ -773,18 +774,10 @@ class FauxRequest extends WebRequest {
        }
 
        public function setSessionData( $key, $data ) {
-               $this->notImplemented( __METHOD__ );
+               $this->session[$key] = $data;
        }
 
        public function isPathInfoBad() {
                return false;
        }
-
-       public function response() {
-               /* Lazy initialization of response object for this request */
-               if ( !is_object( $this->response ) ) {
-                       $this->response = new FauxResponse;
-               }
-               return $this->response;
-       }
 }