Partial revert I0d0ef26f59721039b2c24ab322fa3bf6ab16fea1
[lhc/web/wiklou.git] / maintenance / wrapOldPasswords.php
index 1fc0f37..00046d3 100644 (file)
@@ -1,7 +1,4 @@
 <?php
-
-use MediaWiki\MediaWikiServices;
-
 /**
  * Maintenance script to wrap all old-style passwords in a layered type
  *
@@ -23,8 +20,11 @@ use MediaWiki\MediaWikiServices;
  * @file
  * @ingroup Maintenance
  */
+
 require_once __DIR__ . '/Maintenance.php';
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Maintenance script to wrap all passwords of a certain type in a specified layered
  * type that wraps around the old type.
@@ -43,8 +43,7 @@ class WrapOldPasswords extends Maintenance {
        }
 
        public function execute() {
-               $passwordFactory = new PasswordFactory();
-               $passwordFactory->init( RequestContext::getMain()->getConfig() );
+               $passwordFactory = MediaWikiServices::getInstance()->getPasswordFactory();
 
                $typeInfo = $passwordFactory->getTypes();
                $layeredType = $this->getOption( 'type' );
@@ -115,7 +114,7 @@ class WrapOldPasswords extends Maintenance {
 
                        // Clear memcached so old passwords are wiped out
                        foreach ( $updateUsers as $user ) {
-                               $user->clearSharedCache();
+                               $user->clearSharedCache( 'refresh' );
                        }
                } while ( $res->numRows() );
        }