'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',
'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',
'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',
}
}
+/* 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.
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;
- }
-}