jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Added some constants to speed up Setup.php"
......................................................................


Revert "Added some constants to speed up Setup.php"

This patch causes php maintenance/getConfiguration.php  to die with a fatal
error:

Fatal error: Call to a member function isItemLoaded() on a non-object
  in includes/GlobalFunctions.php on line 1268
 
Call Stack:
  1. {main}() maintenance/getConfiguration.php:0
  2. require_once('maintenance/doMaintenance.php')
       maintenance/getConfiguration.php:196
  3. wfLogProfilingData() maintenance/doMaintenance.php:116

When calling wfLogProfilingData() the $wgUser is undefined which causes the
fatal at:

  if ( $wgUser->isItemLoaded( 'id' ) && $wgUser->isAnon() ) {
    $forward .= ' anon';
  }
  
This reverts commit 2c9de255f71501b749c2b700d0da6fc911358b62.

Change-Id: I093d8fbe2c08875808868d449a90b620cc6c94a6
---
M includes/Setup.php
M maintenance/getConfiguration.php
2 files changed, 41 insertions(+), 48 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Setup.php b/includes/Setup.php
index d1269ad..531d1a4 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -417,8 +417,8 @@
 wfProfileOut( $fname . '-exception' );
 
 wfProfileIn( $fname . '-includes' );
-require_once "$IP/includes/GlobalFunctions.php";
 require_once "$IP/includes/normal/UtfNormalUtil.php";
+require_once "$IP/includes/GlobalFunctions.php";
 require_once "$IP/includes/normal/UtfNormalDefines.php";
 wfProfileOut( $fname . '-includes' );
 
@@ -456,8 +456,6 @@
                )
        );
 }
-
-$wgDeferredUpdateList = array(); // b/c
 
 wfProfileOut( $fname . '-defaults2' );
 wfProfileIn( $fname . '-misc1' );
@@ -503,22 +501,21 @@
 }
 
 wfProfileOut( $fname . '-misc1' );
-if ( !defined( 'MW_SETUP_NO_CACHE' ) ) {
-       wfProfileIn( $fname . '-memcached' );
+wfProfileIn( $fname . '-memcached' );
 
-       $wgMemc = wfGetMainCache();
-       $messageMemc = wfGetMessageCacheStorage();
-       $parserMemc = wfGetParserCacheStorage();
-       $wgLangConvMemc = wfGetLangConverterCacheStorage();
+$wgMemc = wfGetMainCache();
+$messageMemc = wfGetMessageCacheStorage();
+$parserMemc = wfGetParserCacheStorage();
+$wgLangConvMemc = wfGetLangConverterCacheStorage();
 
-       wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' .
-               get_class( $messageMemc ) . '[message] ' .
-               get_class( $parserMemc ) . "[parser]\n" );
+wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' .
+       get_class( $messageMemc ) . '[message] ' .
+       get_class( $parserMemc ) . "[parser]\n" );
 
-       wfProfileOut( $fname . '-memcached' );
-       # # Most of the config is out, some might want to run hooks here.
-       wfRunHooks( 'SetupAfterCache' );
-}
+wfProfileOut( $fname . '-memcached' );
+
+# # Most of the config is out, some might want to run hooks here.
+wfRunHooks( 'SetupAfterCache' );
 
 wfProfileIn( $fname . '-session' );
 
@@ -537,44 +534,42 @@
 }
 
 wfProfileOut( $fname . '-session' );
+wfProfileIn( $fname . '-globals' );
 
-if ( !defined( 'MW_SETUP_NO_CONTEXT' ) ) {
-       wfProfileIn( $fname . '-globals' );
+$wgContLang = Language::factory( $wgLanguageCode );
+$wgContLang->initEncoding();
+$wgContLang->initContLang();
 
-       $wgContLang = Language::factory( $wgLanguageCode );
-       $wgContLang->initEncoding();
-       $wgContLang->initContLang();
+// Now that variant lists may be available...
+$wgRequest->interpolateTitle();
+$wgUser = RequestContext::getMain()->getUser(); # BackCompat
 
-       // Now that variant lists may be available...
-       $wgRequest->interpolateTitle();
-       $wgUser = RequestContext::getMain()->getUser(); # BackCompat
+/**
+ * @var $wgLang Language
+ */
+$wgLang = new StubUserLang;
 
-       /**
-        * @var $wgLang Language
-        */
-       $wgLang = new StubUserLang;
+/**
+ * @var OutputPage
+ */
+$wgOut = RequestContext::getMain()->getOutput(); # BackCompat
 
-       /**
-        * @var OutputPage
-        */
-       $wgOut = RequestContext::getMain()->getOutput(); # BackCompat
+/**
+ * @var $wgParser Parser
+ */
+$wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( 
$wgParserConf ) );
 
-       /**
-        * @var $wgParser Parser
-        */
-       $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( 
$wgParserConf ) );
-
-       if ( !is_object( $wgAuth ) ) {
-               $wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' );
-               wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
-       }
-
-       # Placeholders in case of DB error
-       $wgTitle = null;
-
-       wfProfileOut( $fname . '-globals' );
+if ( !is_object( $wgAuth ) ) {
+       $wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' );
+       wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
 }
 
+# Placeholders in case of DB error
+$wgTitle = null;
+
+$wgDeferredUpdateList = array();
+
+wfProfileOut( $fname . '-globals' );
 wfProfileIn( $fname . '-extensions' );
 
 # Extension setup functions for extensions other than skins
diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php
index 60bb8d8..52cb209 100644
--- a/maintenance/getConfiguration.php
+++ b/maintenance/getConfiguration.php
@@ -23,8 +23,6 @@
  * @author Antoine Musso <[email protected]>
  */
 
-define( 'MW_SETUP_NO_CACHE', 1 );
-define( 'MW_SETUP_NO_CONTEXT', 1 );
 require_once __DIR__ . '/Maintenance.php';
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/111739
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I093d8fbe2c08875808868d449a90b620cc6c94a6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to