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' );
$minUserId = 0;
do {
- $dbw->begin();
+ $this->beginTransaction( $dbw, __METHOD__ );
$res = $dbw->select( 'user',
array( 'user_id', 'user_name', 'user_password' ),
$minUserId = $row->user_id;
}
- $dbw->commit();
+ $this->commitTransaction( $dbw, __METHOD__ );
// Clear memcached so old passwords are wiped out
foreach ( $updateUsers as $user ) {