MediaWiki REL1_31
|
Public Member Functions | |
__construct (IMaintainableDatabase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix=null, $dropCurrentTables=true) | |
cloneTableStructure () | |
Clone the table structure. | |
destroy ( $dropTables=false) | |
Change the prefix back to the original. | |
useTemporaryTables ( $u=true) | |
Set whether to use temporary tables or not. | |
Static Public Member Functions | |
static | changePrefix ( $prefix) |
Change the table prefix on all open DB connections/. | |
Private Attributes | |
IMaintainableDatabase | $db |
bool | $dropCurrentTables = true |
Should we DROP tables containing the new names? | |
string | $newTablePrefix = '' |
Table prefix for cloning. | |
string | $oldTablePrefix = '' |
Current table prefix. | |
array | $tablesToClone = [] |
List of tables to be cloned. | |
bool | $useTemporaryTables = true |
Whether to use temporary tables or not. | |
Definition at line 26 of file CloneDatabase.php.
CloneDatabase::__construct | ( | IMaintainableDatabase | $db, |
array | $tablesToClone, | ||
$newTablePrefix, | |||
$oldTablePrefix = null, | |||
$dropCurrentTables = true ) |
IMaintainableDatabase | $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 52 of file CloneDatabase.php.
References $db, $dropCurrentTables, $newTablePrefix, $oldTablePrefix, and $tablesToClone.
|
static |
Change the table prefix on all open DB connections/.
string | $prefix |
Definition at line 133 of file CloneDatabase.php.
References $wgDBprefix.
Referenced by cloneTableStructure(), destroy(), MediaWikiTestCase\setupDatabaseWithTestPrefix(), and MediaWikiTestCase\teardownTestDB().
CloneDatabase::cloneTableStructure | ( | ) |
Clone the table structure.
Definition at line 73 of file CloneDatabase.php.
References $wgSharedDB, $wgSharedTables, 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 117 of file CloneDatabase.php.
References 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 66 of file CloneDatabase.php.
References useTemporaryTables().
Referenced by cloneTableStructure(), and useTemporaryTables().
|
private |
Definition at line 43 of file CloneDatabase.php.
Referenced by __construct().
|
private |
Should we DROP tables containing the new names?
Definition at line 37 of file CloneDatabase.php.
Referenced by __construct().
|
private |
Table prefix for cloning.
Definition at line 28 of file CloneDatabase.php.
Referenced by __construct().
|
private |
|
private |
List of tables to be cloned.
Definition at line 34 of file CloneDatabase.php.
Referenced by __construct().
|
private |
Whether to use temporary tables or not.
Definition at line 40 of file CloneDatabase.php.