X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fdb%2FCloneDatabase.php;h=c4921e237420dc94ea8a3bb33373217b8cd2ae7c;hb=08c266e1fdebcc13beb419ea655ca9bc487bc712;hp=f1ccd2aebdb82bff7c5de5203fa49622623fccfa;hpb=7874fc4bec845ad92960b07e969c65f3c3fe74f2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index f1ccd2aebd..c4921e2374 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -41,19 +41,19 @@ class CloneDatabase { /** @var bool Whether to use temporary tables or not */ private $useTemporaryTables = true; - /** @var Database */ + /** @var IMaintainableDatabase */ private $db; /** * Constructor * - * @param Database $db A database subclass + * @param IMaintainableDatabase $db A database subclass * @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 bool $dropCurrentTables */ - public function __construct( Database $db, array $tablesToClone, + public function __construct( IMaintainableDatabase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix = '', $dropCurrentTables = true ) { $this->db = $db; @@ -79,7 +79,7 @@ class CloneDatabase { foreach ( $this->tablesToClone as $tbl ) { if ( $wgSharedDB && in_array( $tbl, $wgSharedTables, true ) ) { // Shared tables don't work properly when cloning due to - // how prefixes are handled (bug 65654) + // how prefixes are handled (T67654) throw new RuntimeException( "Cannot clone shared table $tbl." ); } # Clean up from previous aborted run. So that table escaping @@ -107,7 +107,8 @@ class CloneDatabase { # Create new table wfDebug( __METHOD__ . " duplicating $oldTableName to $newTableName\n" ); - $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables ); + $this->db->duplicateTableStructure( + $oldTableName, $newTableName, $this->useTemporaryTables ); } }