r46540 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46539‎ | r46540 | r46541 >
Date:16:54, 29 January 2009
Author:ialex
Status:ok
Tags:
Comment:
Added new setting, $wgConfigureAllowDeferSetup to not use the SetupAfterCache hook, even with database handler
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.func.php (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,10 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.11.15 - 29 January 2009
 6+ New setting $wgConfigureAllowDeferSetup to allow to defer part of
 7+ efConfigureSetup() when using database handler.
 8+
59 0.11.14 - 26 January 2009
610 Added $wgMaxRedirects, $wgInvalidRedirectTargets, $wgNoFollowDomainExceptions
711 and $wgUseTwoButtonsSearchForm.
Index: trunk/extensions/Configure/Configure.php
@@ -17,7 +17,7 @@
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
1919 'description' => 'Allow authorised users to configure the wiki via a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.11.14',
 21+ 'version' => '0.11.15',
2222 );
2323
2424 # Configuration part
@@ -39,6 +39,16 @@
4040 $wgConfigureDatabase = 'config';
4141
4242 /**
 43+ * Whether to allow to defer a part of efConfigureSetup() until the cache
 44+ * objects are set by MediaWiki instead of doing it in efConfigureSetup().
 45+ * It is only used if $wgConfigureHandler is 'db'.
 46+ * If you want to use $wgConfigureExtensionsVar (see below), you may need to
 47+ * set it to false, otherwise the variables won't be set in efConfigureSetup()
 48+ * by later.
 49+ */
 50+$wgConfigureAllowDeferSetup = true;
 51+
 52+/**
4353 * Path for file-system cache, only works when $wgConfigureHandler is 'db'.
4454 */
4555 $wgConfigureFileSystemCache = false;
@@ -88,6 +98,10 @@
8999 * include the file.
90100 * You'll need to handle the variable and include yourself the extension's file.
91101 * Format is $wgConfigureExtensionsVar['ExtensionName'] = 'VarName';
 102+ *
 103+ * WARNING: If you use database handler, you may need to set
 104+ * $wgConfigureAllowDeferSetup = false;
 105+ * to use it correctly.
92106 */
93107 $wgConfigureExtensionsVar = array();
94108
Index: trunk/extensions/Configure/Configure.func.php
@@ -57,7 +57,7 @@
5858 * @param $wiki String
5959 */
6060 function efConfigureSetup( $wiki = 'default' ) {
61 - global $wgConf, $wgConfigureFilesPath, $wgConfigureExtDir;
 61+ global $wgConf, $wgConfigureFilesPath, $wgConfigureExtDir, $wgConfigureHandler, $wgConfigureAllowDeferSetup;
6262 wfProfileIn( __FUNCTION__ );
6363 # Create the new configuration object...
6464 $oldConf = $wgConf;
@@ -73,8 +73,7 @@
7474
7575 $wgConf->snapshotDefaults();
7676
77 - global $wgConfigureHandler;
78 - if ( $wgConfigureHandler == 'db' ) {
 77+ if ( $wgConfigureAllowDeferSetup && $wgConfigureHandler == 'db' ) {
7978 // Defer to after caches and database are set up.
8079 global $wgHooks;
8180 $wgHooks['SetupAfterCache'][] = array( 'efConfigureInitialise' );

Status & tagging log