Use wikimedia/object-factory 1.0.0
[lhc/web/wiklou.git] / includes / auth / AuthManager.php
index 9407c42..47c0df5 100644 (file)
@@ -31,6 +31,7 @@ use Status;
 use StatusValue;
 use User;
 use WebRequest;
+use Wikimedia\ObjectFactory;
 
 /**
  * This serves as the entry point to the authentication system.
@@ -1551,7 +1552,10 @@ class AuthManager implements LoggerAwareInterface {
                // Fetch the user ID from the master, so that we don't try to create the user
                // when they already exist, due to replication lag
                // @codeCoverageIgnoreStart
-               if ( !$localId && wfGetLB()->getReaderIndex() != 0 ) {
+               if (
+                       !$localId &&
+                       MediaWikiServices::getInstance()->getDBLoadBalancer()->getReaderIndex() != 0
+               ) {
                        $localId = User::idFromName( $username, User::READ_LATEST );
                        $flags = User::READ_LATEST;
                }
@@ -2289,7 +2293,7 @@ class AuthManager implements LoggerAwareInterface {
 
                $ret = [];
                foreach ( $specs as $spec ) {
-                       $provider = \ObjectFactory::getObjectFromSpec( $spec );
+                       $provider = ObjectFactory::getObjectFromSpec( $spec );
                        if ( !$provider instanceof $class ) {
                                throw new \RuntimeException(
                                        "Expected instance of $class, got " . get_class( $provider )