summaryrefslogtreecommitdiff
path: root/includes/db/CloneDatabase.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/db/CloneDatabase.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/db/CloneDatabase.php')
-rw-r--r--includes/db/CloneDatabase.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php
index 4e43642f..4e443741 100644
--- a/includes/db/CloneDatabase.php
+++ b/includes/db/CloneDatabase.php
@@ -60,9 +60,9 @@ class CloneDatabase {
* Constructor
*
* @param $db DatabaseBase A database subclass
- * @param $tablesToClone Array An array of tables to clone, unprefixed
- * @param $newTablePrefix String Prefix to assign to the tables
- * @param $oldTablePrefix String Prefix on current tables, if not $wgDBprefix
+ * @param array $tablesToClone An array of tables to clone, unprefixed
+ * @param string $newTablePrefix Prefix to assign to the tables
+ * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix
* @param $dropCurrentTables bool
*/
public function __construct( DatabaseBase $db, array $tablesToClone,
@@ -77,7 +77,7 @@ class CloneDatabase {
/**
* Set whether to use temporary tables or not
- * @param $u Bool Use temporary tables when cloning the structure
+ * @param bool $u Use temporary tables when cloning the structure
*/
public function useTemporaryTables( $u = true ) {
$this->useTemporaryTables = $u;
@@ -87,35 +87,32 @@ class CloneDatabase {
* Clone the table structure
*/
public function cloneTableStructure() {
-
foreach( $this->tablesToClone as $tbl ) {
# Clean up from previous aborted run. So that table escaping
# works correctly across DB engines, we need to change the pre-
# fix back and forth so tableName() works right.
-
+
self::changePrefix( $this->oldTablePrefix );
$oldTableName = $this->db->tableName( $tbl, 'raw' );
-
+
self::changePrefix( $this->newTablePrefix );
$newTableName = $this->db->tableName( $tbl, 'raw' );
-
+
if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) ) ) {
$this->db->dropTable( $tbl, __METHOD__ );
- wfDebug( __METHOD__." dropping {$newTableName}\n", true);
+ wfDebug( __METHOD__ . " dropping {$newTableName}\n", true );
//Dropping the oldTable because the prefix was changed
}
# Create new table
- wfDebug( __METHOD__." duplicating $oldTableName to $newTableName\n", true );
+ wfDebug( __METHOD__ . " duplicating $oldTableName to $newTableName\n", true );
$this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
-
}
-
}
/**
* Change the prefix back to the original.
- * @param $dropTables bool Optionally drop the tables we created
+ * @param bool $dropTables Optionally drop the tables we created
*/
public function destroy( $dropTables = false ) {
if( $dropTables ) {