r89303 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89302‎ | r89303 | r89304 >
Date:23:17, 1 June 2011
Author:demon
Status:ok
Tags:
Comment:
Mostly revert r89302, was slower than the original
Modified paths:
  • /trunk/phase3/tests/phpunit/MediaWikiTestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/MediaWikiTestCase.php
@@ -12,7 +12,6 @@
1313 protected $oldTablePrefix;
1414 protected $useTemporaryTables = true;
1515 private static $dbSetup = false;
16 - private static $dbTables = null;
1716
1817 /**
1918 * Table name prefixes. Oracle likes it shorter.
@@ -192,22 +191,18 @@
193192 protected function listTables() {
194193 global $wgDBprefix;
195194
196 - if( is_null( self::$dbTables ) ) {
197 - $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
198 - $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
 195+ $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
 196+ $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
199197
200 - if ( $this->db->getType() == 'sqlite' ) {
201 - $tables = array_flip( $tables );
202 - // these are subtables of searchindex and don't need to be duped/dropped separately
203 - unset( $tables['searchindex_content'] );
204 - unset( $tables['searchindex_segdir'] );
205 - unset( $tables['searchindex_segments'] );
206 - $tables = array_flip( $tables );
207 - }
208 - self::$dbTables = $tables;
 198+ if ( $this->db->getType() == 'sqlite' ) {
 199+ $tables = array_flip( $tables );
 200+ // these are subtables of searchindex and don't need to be duped/dropped separately
 201+ unset( $tables['searchindex_content'] );
 202+ unset( $tables['searchindex_segdir'] );
 203+ unset( $tables['searchindex_segments'] );
 204+ $tables = array_flip( $tables );
209205 }
210 - return self::$dbTables;
211 -
 206+ return $tables;
212207 }
213208
214209 protected function checkDbIsSupported() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89302Exclude Block tests until somebody fixes them, also cache listTables() result...demon22:54, 1 June 2011

Status & tagging log