Merge "Fix declension in grammar rules for Latin language"
[lhc/web/wiklou.git] / maintenance / migrateUserGroup.php
index c62a5d3..dc20eee 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script that re-assigns users from an old group to a new one.
@@ -41,7 +41,7 @@ class MigrateUserGroup extends Maintenance {
                $count = 0;
                $oldGroup = $this->getArg( 0 );
                $newGroup = $this->getArg( 1 );
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                $start = $dbw->selectField( 'user_groups', 'MIN(ug_user)',
                        array( 'ug_group' => $oldGroup ), __FUNCTION__ );
                $end = $dbw->selectField( 'user_groups', 'MAX(ug_user)',
@@ -58,7 +58,7 @@ class MigrateUserGroup extends Maintenance {
                        $affected = 0;
                        $this->output( "Doing users $blockStart to $blockEnd\n" );
 
-                       $dbw->begin( __METHOD__ );
+                       $this->beginTransaction( $dbw, __METHOD__ );
                        $dbw->update( 'user_groups',
                                array( 'ug_group' => $newGroup ),
                                array( 'ug_group' => $oldGroup,
@@ -77,7 +77,7 @@ class MigrateUserGroup extends Maintenance {
                                __METHOD__
                        );
                        $affected += $dbw->affectedRows();
-                       $dbw->commit( __METHOD__ );
+                       $this->commitTransaction( $dbw, __METHOD__ );
 
                        // Clear cache for the affected users (bug 40340)
                        if ( $affected > 0 ) {