protected $oldTablePrefix;
protected $useTemporaryTables = true;
protected $reuseDB = false;
+ protected $tablesUsed = array(); // tables with data
+
private static $dbSetup = false;
- private static $tablesCloned = array();
/**
* Table name prefixes. Oracle likes it shorter.
$this->oldTablePrefix = $wgDBprefix;
if( !self::$dbSetup ) {
- self::$tablesCloned = $this->initDB();
+ $this->initDB();
self::$dbSetup = true;
}
if ( $this->db->getType() == 'oracle' ) {
$this->db->query( 'BEGIN FILL_WIKI_INFO; END;' );
}
-
- return $tablesCloned;
}
/**
wfGetLB()->closeAll();
$this->db = wfGetDB( DB_MASTER );
} else {
- foreach( self::$tablesCloned as $tbl ) {
+ foreach( $this->tablesUsed as $tbl ) {
if( $tbl == 'interwiki') continue;
$this->db->query( 'TRUNCATE TABLE '.$this->db->tableName($tbl), __METHOD__ );
}
}
} else {
- foreach( self::$tablesCloned as $tbl ) {
+ foreach( $this->tablesUsed as $tbl ) {
if( $tbl == 'interwiki' || $tbl == 'user' ) continue;
$this->db->delete( $tbl, '*', __METHOD__ );
}