namespace MediaWiki\Session;
+use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerInterface;
use BagOStuff;
use CachedBagOStuff;
* The intention is that the named account will never again be usable for
* normal login (i.e. there is no way to undo the prevention of access).
*
- * @private For use from \\User::newSystemUser only
+ * @private For use from \User::newSystemUser only
* @param string $username
*/
public function preventSessionsForUser( $username ) {
/**
* Deregister a SessionBackend
- * @private For use from \\MediaWiki\\Session\\SessionBackend only
+ * @private For use from \MediaWiki\Session\SessionBackend only
* @param SessionBackend $backend
*/
public function deregisterSessionBackend( SessionBackend $backend ) {
/**
* Change a SessionBackend's ID
- * @private For use from \\MediaWiki\\Session\\SessionBackend only
+ * @private For use from \MediaWiki\Session\SessionBackend only
* @param SessionBackend $backend
*/
public function changeBackendId( SessionBackend $backend ) {
* Reset the internal caching for unit testing
*/
public static function resetCache() {
- if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
- // @codeCoverageIgnoreStart
- throw new MWException( __METHOD__ . ' may only be called from unit tests!' );
- // @codeCoverageIgnoreEnd
- }
+ MediaWikiServices::failUnlessBootstrapping( __METHOD__ );
self::$globalSession = null;
self::$globalSessionRequest = null;