Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/263207
Change subject: Revert "RequestContext: Load the request object for getRequest
on first call"
......................................................................
Revert "RequestContext: Load the request object for getRequest on first call"
I *think* this is making the MassMessage tests fail. Investigating.
This reverts commit 4555d1b482816730b25e6956444ca6a3155dd2cd.
Change-Id: I691c85ae7c4440b37a2d7d059d2e6a64cb79d9e2
---
M includes/Setup.php
M includes/context/RequestContext.php
2 files changed, 7 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/07/263207/1
diff --git a/includes/Setup.php b/includes/Setup.php
index f72f5ca..bd20ac3 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -614,13 +614,15 @@
$wgDBerrorLogTZ = $wgLocaltimezone;
}
-// initialize the request object in $wgRequest
-$wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
-
// Useful debug output
if ( $wgCommandLineMode ) {
+ $wgRequest = new FauxRequest( array() );
+
wfDebug( "\n\nStart command line script $self\n" );
} else {
+ // Can't stub this one, it sets up $_GET and $_REQUEST in its
constructor
+ $wgRequest = new WebRequest;
+
$debug = "\n\nStart request {$wgRequest->getMethod()}
{$wgRequest->getRequestURL()}\n";
if ( $wgDebugPrintHttpHeaders ) {
diff --git a/includes/context/RequestContext.php
b/includes/context/RequestContext.php
index 8c13e97..4f8e65d 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -121,13 +121,8 @@
*/
public function getRequest() {
if ( $this->request === null ) {
- global $wgCommandLineMode;
- // create the WebRequest object on the fly
- if ( $wgCommandLineMode ) {
- $this->request = new FauxRequest( array() );
- } else {
- $this->request = new WebRequest();
- }
+ global $wgRequest; # fallback to $wg till we can
improve this
+ $this->request = $wgRequest;
}
return $this->request;
--
To view, visit https://gerrit.wikimedia.org/r/263207
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I691c85ae7c4440b37a2d7d059d2e6a64cb79d9e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits