Merge "Add IContextSource as parameter to ChangeTags::formatSummaryRow"
[lhc/web/wiklou.git] / maintenance / wrapOldPasswords.php
index 37272a0..2534ca6 100644 (file)
@@ -32,7 +32,7 @@ require_once __DIR__ . '/Maintenance.php';
 class WrapOldPasswords extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Wrap all passwords of a certain type in a new layered type";
+               $this->addDescription( 'Wrap all passwords of a certain type in a new layered type' );
                $this->addOption( 'type',
                        'Password type to wrap passwords in (must inherit LayeredParameterizedPassword)', true, true );
                $this->addOption( 'verbose', 'Enables verbose output', false, false, 'v' );
@@ -72,7 +72,7 @@ class WrapOldPasswords extends Maintenance {
 
                $minUserId = 0;
                do {
-                       $dbw->begin();
+                       $this->beginTransaction( $dbw, __METHOD__ );
 
                        $res = $dbw->select( 'user',
                                array( 'user_id', 'user_name', 'user_password' ),
@@ -112,7 +112,7 @@ class WrapOldPasswords extends Maintenance {
                                $minUserId = $row->user_id;
                        }
 
-                       $dbw->commit();
+                       $this->commitTransaction( $dbw, __METHOD__ );
 
                        // Clear memcached so old passwords are wiped out
                        foreach ( $updateUsers as $user ) {