From: Aaron Schulz Date: Sun, 22 Dec 2013 23:19:23 +0000 (-0800) Subject: Added some constants to speed up Setup.php X-Git-Tag: 1.31.0-rc.0~17152 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=2c9de255f71501b749c2b700d0da6fc911358b62;p=lhc%2Fweb%2Fwiklou.git Added some constants to speed up Setup.php Change-Id: I528b362d6ef3d07c6c301e7a1767a1be0fc93725 --- diff --git a/includes/Setup.php b/includes/Setup.php index 531d1a46e3..d1269ad595 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -417,8 +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/normal/UtfNormalUtil.php"; require_once "$IP/includes/normal/UtfNormalDefines.php"; wfProfileOut( $fname . '-includes' ); @@ -457,6 +457,8 @@ if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) { ); } +$wgDeferredUpdateList = array(); // b/c + wfProfileOut( $fname . '-defaults2' ); wfProfileIn( $fname . '-misc1' ); @@ -501,21 +503,22 @@ if ( $wgCommandLineMode ) { } wfProfileOut( $fname . '-misc1' ); -wfProfileIn( $fname . '-memcached' ); - -$wgMemc = wfGetMainCache(); -$messageMemc = wfGetMessageCacheStorage(); -$parserMemc = wfGetParserCacheStorage(); -$wgLangConvMemc = wfGetLangConverterCacheStorage(); +if ( !defined( 'MW_SETUP_NO_CACHE' ) ) { + wfProfileIn( $fname . '-memcached' ); -wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' . - get_class( $messageMemc ) . '[message] ' . - get_class( $parserMemc ) . "[parser]\n" ); + $wgMemc = wfGetMainCache(); + $messageMemc = wfGetMessageCacheStorage(); + $parserMemc = wfGetParserCacheStorage(); + $wgLangConvMemc = wfGetLangConverterCacheStorage(); -wfProfileOut( $fname . '-memcached' ); + wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' . + get_class( $messageMemc ) . '[message] ' . + get_class( $parserMemc ) . "[parser]\n" ); -# # 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' ); @@ -534,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 ) ); -# Placeholders in case of DB error -$wgTitle = null; + 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' ); +} -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 52cb209ce8..60bb8d8d2c 100644 --- a/maintenance/getConfiguration.php +++ b/maintenance/getConfiguration.php @@ -23,6 +23,8 @@ * @author Antoine Musso */ +define( 'MW_SETUP_NO_CACHE', 1 ); +define( 'MW_SETUP_NO_CONTEXT', 1 ); require_once __DIR__ . '/Maintenance.php'; /**