Merge "Add PreferencesFormPreSave hook"
[lhc/web/wiklou.git] / includes / Setup.php
index eef5ccb..d1269ad 100644 (file)
@@ -248,13 +248,6 @@ foreach ( $wgForeignFileRepos as &$repo ) {
 }
 unset( $repo ); // no global pollution; destroy reference
 
-if ( is_null( $wgEnableAutoRotation ) ) {
-       wfProfileIn( $fname . '-defaults-rotation' );
-       // Only enable auto-rotation when the bitmap handler can rotate
-       $wgEnableAutoRotation = BitmapHandler::canRotate();
-       wfProfileOut( $fname . '-defaults-rotation' );
-}
-
 if ( $wgRCFilterByAge ) {
        # # Trim down $wgRCLinkDays so that it only lists links which are valid
        # # as determined by $wgRCMaxAge.
@@ -424,9 +417,8 @@ MWExceptionHandler::installHandler();
 wfProfileOut( $fname . '-exception' );
 
 wfProfileIn( $fname . '-includes' );
-require_once "$IP/includes/normal/UtfNormalUtil.php";
 require_once "$IP/includes/GlobalFunctions.php";
-require_once "$IP/includes/ProxyTools.php";
+require_once "$IP/includes/normal/UtfNormalUtil.php";
 require_once "$IP/includes/normal/UtfNormalDefines.php";
 wfProfileOut( $fname . '-includes' );
 
@@ -465,6 +457,8 @@ if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
        );
 }
 
+$wgDeferredUpdateList = array(); // b/c
+
 wfProfileOut( $fname . '-defaults2' );
 wfProfileIn( $fname . '-misc1' );
 
@@ -509,21 +503,22 @@ if ( $wgCommandLineMode ) {
 }
 
 wfProfileOut( $fname . '-misc1' );
-wfProfileIn( $fname . '-memcached' );
+if ( !defined( 'MW_SETUP_NO_CACHE' ) ) {
+       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' );
 
@@ -542,42 +537,44 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
 }
 
 wfProfileOut( $fname . '-session' );
-wfProfileIn( $fname . '-globals' );
 
-$wgContLang = Language::factory( $wgLanguageCode );
-$wgContLang->initEncoding();
-$wgContLang->initContLang();
+if ( !defined( 'MW_SETUP_NO_CONTEXT' ) ) {
+       wfProfileIn( $fname . '-globals' );
 
-// Now that variant lists may be available...
-$wgRequest->interpolateTitle();
-$wgUser = RequestContext::getMain()->getUser(); # BackCompat
+       $wgContLang = Language::factory( $wgLanguageCode );
+       $wgContLang->initEncoding();
+       $wgContLang->initContLang();
 
-/**
- * @var $wgLang Language
- */
-$wgLang = new StubUserLang;
+       // Now that variant lists may be available...
+       $wgRequest->interpolateTitle();
+       $wgUser = RequestContext::getMain()->getUser(); # BackCompat
 
-/**
* @var OutputPage
- */
-$wgOut = RequestContext::getMain()->getOutput(); # BackCompat
+       /**
       * @var $wgLang Language
       */
+       $wgLang = new StubUserLang;
 
-/**
- * @var $wgParser Parser
- */
-$wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
+       /**
+        * @var OutputPage
       */
+       $wgOut = RequestContext::getMain()->getOutput(); # BackCompat
 
-if ( !is_object( $wgAuth ) ) {
-       $wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' );
-       wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
-}
+       /**
+        * @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;
+       # Placeholders in case of DB error
+       $wgTitle = null;
 
-$wgDeferredUpdateList = array();
+       wfProfileOut( $fname . '-globals' );
+}
 
-wfProfileOut( $fname . '-globals' );
 wfProfileIn( $fname . '-extensions' );
 
 # Extension setup functions for extensions other than skins