Merge "Add CollationFa"
[lhc/web/wiklou.git] / includes / auth / AuthManager.php
index e223e16..e9a6edc 100644 (file)
@@ -24,6 +24,7 @@
 namespace MediaWiki\Auth;
 
 use Config;
+use MediaWiki\MediaWikiServices;
 use Psr\Log\LoggerAwareInterface;
 use Psr\Log\LoggerInterface;
 use Status;
@@ -146,7 +147,7 @@ class AuthManager implements LoggerAwareInterface {
                if ( self::$instance === null ) {
                        self::$instance = new self(
                                \RequestContext::getMain()->getRequest(),
-                               \ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
+                               MediaWikiServices::getInstance()->getMainConfig()
                        );
                }
                return self::$instance;
@@ -1678,7 +1679,7 @@ class AuthManager implements LoggerAwareInterface {
 
                // Ignore warnings about master connections/writes...hard to avoid here
                $trxProfiler = \Profiler::instance()->getTransactionProfiler();
-               $trxProfiler->setSilenced( true );
+               $old = $trxProfiler->setSilenced( true );
                try {
                        $status = $user->addToDatabase();
                        if ( !$status->isOK() ) {
@@ -1704,7 +1705,7 @@ class AuthManager implements LoggerAwareInterface {
                                return $status;
                        }
                } catch ( \Exception $ex ) {
-                       $trxProfiler->setSilenced( false );
+                       $trxProfiler->setSilenced( $old );
                        $this->logger->error( __METHOD__ . ': {username} failed with exception {exception}', [
                                'username' => $username,
                                'exception' => $ex,
@@ -1743,7 +1744,7 @@ class AuthManager implements LoggerAwareInterface {
                        $logEntry->insert();
                }
 
-               $trxProfiler->setSilenced( false );
+               $trxProfiler->setSilenced( $old );
 
                if ( $login ) {
                        $this->setSessionDataForUser( $user );
@@ -2382,7 +2383,7 @@ class AuthManager implements LoggerAwareInterface {
                $session->set( 'AuthManager:lastAuthTimestamp', time() );
                $session->persist();
 
-               \ScopedCallback::consume( $delay );
+               \Wikimedia\ScopedCallback::consume( $delay );
 
                \Hooks::run( 'UserLoggedIn', [ $user ] );
        }