'SquidPurgeClientPool' => 'includes/SquidPurgeClient.php',
'Status' => 'includes/Status.php',
'StubContLang' => 'includes/StubObject.php',
- 'StubUser' => 'includes/StubObject.php',
'StubUserLang' => 'includes/StubObject.php',
'StubObject' => 'includes/StubObject.php',
'StringUtils' => 'includes/StringUtils.php',
// Now that variant lists may be available...
$wgRequest->interpolateTitle();
-
-$wgUser = new StubUser;
+$wgUser = $wgCommandLineMode ? new User : User::newFromSession();
$wgLang = new StubUserLang;
$wgOut = new StubObject( 'wgOut', 'OutputPage' );
$wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
}
}
}
-
-/**
- * Stub object for the user. The initialisation of the will depend of
- * $wgCommandLineMode. If it's true, it will be an anonymous user and if it's
- * false, the user will be loaded from credidentails provided by cookies. This
- * object have to be in $wgUser global.
- */
-class StubUser extends StubObject {
-
- function __construct() {
- parent::__construct( 'wgUser' );
- }
-
- function __call( $name, $args ) {
- return $this->_call( $name, $args );
- }
-
- function _newObject() {
- global $wgCommandLineMode;
- if( $wgCommandLineMode ) {
- $user = new User;
- } else {
- $user = User::newFromSession();
- }
- return $user;
- }
-}