dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Begin exposing SiteConfiguration via site contexts"
[lhc/web/wiklou.git]
/
includes
/
context
/
RequestContext.php
diff --git
a/includes/context/RequestContext.php
b/includes/context/RequestContext.php
index
2822c48
..
5f91731
100644
(file)
--- a/
includes/context/RequestContext.php
+++ b/
includes/context/RequestContext.php
@@
-109,6
+109,7
@@
class RequestContext implements IContextSource {
global $wgRequest; # fallback to $wg till we can improve this
$this->request = $wgRequest;
}
global $wgRequest; # fallback to $wg till we can improve this
$this->request = $wgRequest;
}
+
return $this->request;
}
return $this->request;
}
@@
-116,6
+117,7
@@
class RequestContext implements IContextSource {
* Set the Title object
*
* @param Title $t
* Set the Title object
*
* @param Title $t
+ * @throws MWException
*/
public function setTitle( $t ) {
if ( $t !== null && !$t instanceof Title ) {
*/
public function setTitle( $t ) {
if ( $t !== null && !$t instanceof Title ) {
@@
-136,6
+138,7
@@
class RequestContext implements IContextSource {
global $wgTitle; # fallback to $wg till we can improve this
$this->title = $wgTitle;
}
global $wgTitle; # fallback to $wg till we can improve this
$this->title = $wgTitle;
}
+
return $this->title;
}
return $this->title;
}
@@
-196,6
+199,7
@@
class RequestContext implements IContextSource {
}
$this->wikipage = WikiPage::factory( $title );
}
}
$this->wikipage = WikiPage::factory( $title );
}
+
return $this->wikipage;
}
return $this->wikipage;
}
@@
-215,6
+219,7
@@
class RequestContext implements IContextSource {
if ( $this->output === null ) {
$this->output = new OutputPage( $this );
}
if ( $this->output === null ) {
$this->output = new OutputPage( $this );
}
+
return $this->output;
}
return $this->output;
}
@@
-236,6
+241,7
@@
class RequestContext implements IContextSource {
if ( $this->user === null ) {
$this->user = User::newFromSession( $this->getRequest() );
}
if ( $this->user === null ) {
$this->user = User::newFromSession( $this->getRequest() );
}
+
return $this->user;
}
return $this->user;
}
@@
-296,6
+302,7
@@
class RequestContext implements IContextSource {
*/
public function getLang() {
wfDeprecated( __METHOD__, '1.19' );
*/
public function getLang() {
wfDeprecated( __METHOD__, '1.19' );
+
return $this->getLanguage();
}
return $this->getLanguage();
}
@@
-391,6
+398,7
@@
class RequestContext implements IContextSource {
$this->skin->setContext( $this );
wfProfileOut( __METHOD__ . '-createskin' );
}
$this->skin->setContext( $this );
wfProfileOut( __METHOD__ . '-createskin' );
}
+
return $this->skin;
}
return $this->skin;
}
@@
-404,6
+412,7
@@
class RequestContext implements IContextSource {
*/
public function msg() {
$args = func_get_args();
*/
public function msg() {
$args = func_get_args();
+
return call_user_func_array( 'wfMessage', $args )->setContext( $this );
}
return call_user_func_array( 'wfMessage', $args )->setContext( $this );
}
@@
-419,6
+428,7
@@
class RequestContext implements IContextSource {
if ( $instance === null ) {
$instance = new self;
}
if ( $instance === null ) {
$instance = new self;
}
+
return $instance;
}
return $instance;
}
@@
-473,7
+483,7
@@
class RequestContext implements IContextSource {
$user = User::newFromName( $params['ip'], false );
}
$user = User::newFromName( $params['ip'], false );
}
- $importSessionFunction = function( User $user, array $params ) {
+ $importSessionFunction = function
( User $user, array $params ) {
global $wgRequest, $wgUser;
$context = RequestContext::getMain();
global $wgRequest, $wgUser;
$context = RequestContext::getMain();
@@
-509,7
+519,7
@@
class RequestContext implements IContextSource {
$importSessionFunction( $user, $params );
// Set callback to save and close the new session and reload the old one
$importSessionFunction( $user, $params );
// Set callback to save and close the new session and reload the old one
- return new ScopedCallback( function() use ( $importSessionFunction, $oUser, $oParams ) {
+ return new ScopedCallback( function
() use ( $importSessionFunction, $oUser, $oParams ) {
$importSessionFunction( $oUser, $oParams );
} );
}
$importSessionFunction( $oUser, $oParams );
} );
}
@@
-537,6
+547,7
@@
class RequestContext implements IContextSource {
$context->setRequest( new FauxRequest( $request ) );
}
$context->user = User::newFromName( '127.0.0.1', false );
$context->setRequest( new FauxRequest( $request ) );
}
$context->user = User::newFromName( '127.0.0.1', false );
+
return $context;
}
}
return $context;
}
}