* @file
*/
+use Wikimedia\AtEase\AtEase;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use Wikimedia\ScopedCallback;
*/
public function setUser( User $user ) {
$this->user = $user;
+ // Invalidate cached user interface language
+ $this->lang = null;
}
/**
$obj = Language::factory( $code );
$this->lang = $obj;
}
-
- unset( $this->recursion );
- }
- catch ( Exception $ex ) {
+ } finally {
unset( $this->recursion );
- throw $ex;
}
}
if ( $this->skin === null ) {
$skin = null;
Hooks::run( 'RequestContextCreateSkin', [ $this, &$skin ] );
- $factory = SkinFactory::getDefaultInstance();
+ $factory = MediaWikiServices::getInstance()->getSkinFactory();
// If the hook worked try to set a skin from it
if ( $skin instanceof Skin ) {
$wgUser = $context->getUser(); // b/c
if ( $session && MediaWiki\Session\PHPSessionHandler::isEnabled() ) {
session_id( $session->getId() );
- Wikimedia\quietCall( 'session_start' );
+ AtEase::quietCall( 'session_start' );
}
$request = new FauxRequest( [], false, $session );
$request->setIP( $params['ip'] );