Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / session / SessionManager.php
index 8ccb6d1..0041450 100644 (file)
@@ -23,6 +23,7 @@
 
 namespace MediaWiki\Session;
 
+use MediaWiki\MediaWikiServices;
 use MWException;
 use Psr\Log\LoggerInterface;
 use BagOStuff;
@@ -35,8 +36,15 @@ use WebRequest;
 /**
  * This serves as the entry point to the MediaWiki session handling system.
  *
+ * Most methods here are for internal use by session handling code. Other callers
+ * should only use getGlobalSession and the methods of SessionManagerInterface;
+ * the rest of the functionality is exposed via MediaWiki\Session\Session methods.
+ *
+ * To provide custom session handling, implement a MediaWiki\Session\SessionProvider.
+ *
  * @ingroup Session
  * @since 1.27
+ * @see https://www.mediawiki.org/wiki/Manual:SessionManager_and_AuthManager
  */
 final class SessionManager implements SessionManagerInterface {
        /** @var SessionManager|null */
@@ -145,7 +153,7 @@ final class SessionManager implements SessionManagerInterface {
                                );
                        }
                } else {
-                       $this->config = \ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
+                       $this->config = MediaWikiServices::getInstance()->getMainConfig();
                }
 
                if ( isset( $options['logger'] ) ) {
@@ -819,9 +827,9 @@ final class SessionManager implements SessionManagerInterface {
        }
 
        /**
-        * Create a session corresponding to the passed SessionInfo
+        * Create a Session corresponding to the passed SessionInfo
         * @private For use by a SessionProvider that needs to specially create its
-        *  own session.
+        *  own Session. Most session providers won't need this.
         * @param SessionInfo $info
         * @param WebRequest $request
         * @return Session
@@ -873,7 +881,7 @@ final class SessionManager implements SessionManagerInterface {
                        $session->resetId();
                }
 
-               \ScopedCallback::consume( $delay );
+               \Wikimedia\ScopedCallback::consume( $delay );
                return $session;
        }
 
@@ -941,6 +949,7 @@ final class SessionManager implements SessionManagerInterface {
 
        /**
         * Reset the internal caching for unit testing
+        * @protected Unit tests only
         */
        public static function resetCache() {
                if ( !defined( 'MW_PHPUNIT_TEST' ) ) {