Move FakeResultWrapper to Database.php, allowing more special pages and extensions...
authorX! <soxred93@users.mediawiki.org>
Thu, 15 Jul 2010 22:39:48 +0000 (22:39 +0000)
committerX! <soxred93@users.mediawiki.org>
Thu, 15 Jul 2010 22:39:48 +0000 (22:39 +0000)
includes/AutoLoader.php
includes/db/Database.php
includes/specials/SpecialAllmessages.php

index 251f3ba..f75c422 100644 (file)
@@ -352,6 +352,7 @@ $wgAutoloadLocalClasses = array(
        'DBObject' => 'includes/db/Database.php',
        'DBQueryError' => 'includes/db/Database.php',
        'DBUnexpectedError' => 'includes/db/Database.php',
+       'FakeResultWrapper' => 'includes/db/Database.php',
        'IBM_DB2Blob' => 'includes/db/DatabaseIbm_db2.php',
        'LBFactory' => 'includes/db/LBFactory.php',
        'LBFactory_Multi' => 'includes/db/LBFactory_Multi.php',
@@ -536,7 +537,6 @@ $wgAutoloadLocalClasses = array(
        'EmailConfirmation' => 'includes/specials/SpecialConfirmemail.php',
        'EmailInvalidation' => 'includes/specials/SpecialConfirmemail.php',
        'SpecialEmailUser' => 'includes/specials/SpecialEmailuser.php',
-       'FakeResultWrapper' => 'includes/specials/SpecialAllmessages.php',
        'FewestrevisionsPage' => 'includes/specials/SpecialFewestrevisions.php',
        'FileDuplicateSearchPage' => 'includes/specials/SpecialFileDuplicateSearch.php',
        'IPBlockForm' => 'includes/specials/SpecialBlockip.php',
@@ -603,7 +603,6 @@ $wgAutoloadLocalClasses = array(
        'SpecialTags' => 'includes/specials/SpecialTags.php',
        'SpecialUnlockdb' => 'includes/specials/SpecialUnlockdb.php',
        'SpecialUpload' => 'includes/specials/SpecialUpload.php',
-       'SpecialUserlogout' => 'includes/specials/SpecialUserlogout.php',
        'SpecialVersion' => 'includes/specials/SpecialVersion.php',
        'SpecialWhatlinkshere' => 'includes/specials/SpecialWhatlinkshere.php',
        'SpecialWhatLinksHere' => 'includes/specials/SpecialWhatlinkshere.php',
index e4f278e..fef3e32 100644 (file)
@@ -2835,6 +2835,47 @@ class ResultWrapper implements Iterator {
        }
 }
 
+/* Overloads the relevant methods of the real ResultsWrapper so it
+ * doesn't go anywhere near an actual database.
+ */
+class FakeResultWrapper extends ResultWrapper {
+
+       var $result     = array();
+       var $db         = null; // And it's going to stay that way :D
+       var $pos        = 0;
+       var $currentRow = null;
+
+       function __construct( $array ){
+               $this->result = $array;
+       }
+
+       function numRows() {
+               return count( $this->result );
+       }
+
+       function fetchRow() {
+               $this->currentRow = $this->result[$this->pos++];
+               return $this->currentRow;
+       }
+
+       function seek( $row ) {
+               $this->pos = $row;
+       }
+
+       function free() {}
+
+       // Callers want to be able to access fields with $this->fieldName
+       function fetchObject(){
+               $this->currentRow = $this->result[$this->pos++];
+               return (object)$this->currentRow;
+       }
+
+       function rewind() {
+               $this->pos = 0;
+               $this->currentRow = null;
+       }
+}
+
 /**
  * Used by DatabaseBase::buildLike() to represent characters that have special meaning in SQL LIKE clauses
  * and thus need no escaping. Don't instantiate it manually, use Database::anyChar() and anyString() instead.
index 902e6c5..ec6a09e 100644 (file)
@@ -393,43 +393,4 @@ class AllmessagesTablePager extends TablePager {
                return '';
        }
 }
-/* Overloads the relevant methods of the real ResultsWrapper so it
- * doesn't go anywhere near an actual database.
- */
-class FakeResultWrapper extends ResultWrapper {
-
-       var $result     = array();
-       var $db         = null; // And it's going to stay that way :D
-       var $pos        = 0;
-       var $currentRow = null;
-
-       function __construct( $array ){
-               $this->result = $array;
-       }
-
-       function numRows() {
-               return count( $this->result );
-       }
-
-       function fetchRow() {
-               $this->currentRow = $this->result[$this->pos++];
-               return $this->currentRow;
-       }
 
-       function seek( $row ) {
-               $this->pos = $row;
-       }
-
-       function free() {}
-
-       // Callers want to be able to access fields with $this->fieldName
-       function fetchObject(){
-               $this->currentRow = $this->result[$this->pos++];
-               return (object)$this->currentRow;
-       }
-
-       function rewind() {
-               $this->pos = 0;
-               $this->currentRow = null;
-       }
-}