MediaWiki
1.23.2
|
Public Member Functions | |
__construct (DatabaseBase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix='', $dropCurrentTables=true) | |
Constructor. More... | |
cloneTableStructure () | |
Clone the table structure. More... | |
destroy ( $dropTables=false) | |
Change the prefix back to the original. More... | |
useTemporaryTables ( $u=true) | |
Set whether to use temporary tables or not. More... | |
Static Public Member Functions | |
static | changeDBPrefix ( $db, $prefix) |
static | changeLBPrefix ( $lb, $prefix) |
static | changePrefix ( $prefix) |
Change the table prefix on all open DB connections/. More... | |
Private Attributes | |
bool | $dropCurrentTables = true |
Should we DROP tables containing the new names? *. More... | |
string | $newTablePrefix = '' |
Table prefix for cloning *. More... | |
string | $oldTablePrefix = '' |
Current table prefix *. More... | |
array | $tablesToClone = array() |
List of tables to be cloned *. More... | |
bool | $useTemporaryTables = true |
Whether to use temporary tables or not *. More... | |
Definition at line 27 of file CloneDatabase.php.
CloneDatabase::__construct | ( | DatabaseBase | $db, |
array | $tablesToClone, | ||
$newTablePrefix, | |||
$oldTablePrefix = '' , |
|||
$dropCurrentTables = true |
|||
) |
Constructor.
DatabaseBase | $db | A database subclass |
array | $tablesToClone | An array of tables to clone, unprefixed |
string | $newTablePrefix | Prefix to assign to the tables |
string | $oldTablePrefix | Prefix on current tables, if not $wgDBprefix |
bool | $dropCurrentTables |
Definition at line 47 of file CloneDatabase.php.
References $dropCurrentTables, $newTablePrefix, $oldTablePrefix, and $tablesToClone.
|
static |
DatabaseBase | $db | |
string | $prefix |
Definition at line 134 of file CloneDatabase.php.
|
static |
LoadBalancer | $lb | |
string | $prefix |
Definition at line 125 of file CloneDatabase.php.
|
static |
Change the table prefix on all open DB connections/.
string | $prefix |
Definition at line 114 of file CloneDatabase.php.
References array(), global, and wfGetLBFactory().
Referenced by cloneTableStructure(), destroy(), MediaWikiTestCase\setupTestDB(), and MediaWikiTestCase\teardownTestDB().
CloneDatabase::cloneTableStructure | ( | ) |
Clone the table structure.
Definition at line 68 of file CloneDatabase.php.
References array(), as, changePrefix(), useTemporaryTables(), and wfDebug().
CloneDatabase::destroy | ( | $dropTables = false | ) |
Change the prefix back to the original.
bool | $dropTables | Optionally drop the tables we created |
Definition at line 98 of file CloneDatabase.php.
References as, and changePrefix().
CloneDatabase::useTemporaryTables | ( | $u = true | ) |
Set whether to use temporary tables or not.
bool | $u | Use temporary tables when cloning the structure |
Definition at line 61 of file CloneDatabase.php.
Referenced by cloneTableStructure().
|
private |
Should we DROP tables containing the new names? *.
Definition at line 34 of file CloneDatabase.php.
Referenced by __construct().
|
private |
Table prefix for cloning *.
Definition at line 28 of file CloneDatabase.php.
Referenced by __construct().
|
private |
Current table prefix *.
Definition at line 30 of file CloneDatabase.php.
Referenced by __construct().
List of tables to be cloned *.
Definition at line 32 of file CloneDatabase.php.
Referenced by __construct().
|
private |
Whether to use temporary tables or not *.
Definition at line 36 of file CloneDatabase.php.