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

Change subject: Added config file registry
......................................................................


Added config file registry

This change introduces a simple config file registry that allows
extensions to dynamically add config files that will be included with
BlueSpice.

A follow up commit of BlueSpiceExtensions will be necessary for this to
work.

Change-Id: I8eb4d80a5d832b5bd874762d03642587576b80d0
---
M includes/CoreHooks.php
M includes/DefaultSettings.php
2 files changed, 21 insertions(+), 8 deletions(-)

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



diff --git a/includes/CoreHooks.php b/includes/CoreHooks.php
index 929987f..5d164a8 100755
--- a/includes/CoreHooks.php
+++ b/includes/CoreHooks.php
@@ -10,16 +10,14 @@
                $wgNamespacePermissionLockdown, $wgSpecialPageLockdown, 
$wgActionLockdown, $wgNonincludableNamespaces,
                $wgExtraNamespaces, $wgContentNamespaces, 
$wgNamespacesWithSubpages, $wgNamespacesToBeSearchedDefault,
                $wgLocalisationCacheConf, $wgAutoloadLocalClasses, 
$wgFlaggedRevsNamespaces, $wgNamespaceAliases, $wgVersion;
+               /*
+                * TODO: All those globals above can be removed once all 
included
+                * settings files use $GLOBALS['wg...'] to access them
+                */
 
-               $sConfigPath = BSCONFIGDIR;
-               $aConfigFiles = array(
-                       'nm-settings.php',
-                       'gm-settings.php',
-                       'pm-settings.php'
-               );
+               global $bsgConfigFiles;
 
-               foreach ( $aConfigFiles as $sConfigFile) {
-                       $sConfigFilePath = $sConfigPath . DS . $sConfigFile;
+               foreach( $bsgConfigFiles as $sConfigFileKey => $sConfigFilePath 
) {
                        if ( file_exists( $sConfigFilePath ) ) {
                                include( $sConfigFilePath );
                        }
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 30575aa..ad6336f 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -181,3 +181,18 @@
 $bsgSystemNamespaces = array(
        //1599 => 'NS_COOL_STUFF'
 );
+
+/**
+ * PHP config files registered here will be included on "SetupAfterCache"
+ * time. Access to all global config variables need to be in the form of
+ * $GLOBALS['wg...'] as the inclusion will be done in callback function scope
+ * rather than in global scope.
+ */
+$bsgConfigFiles = array(
+       //'extensionname' => 'path/to/file.php'
+
+       //Pre-registering for BC; Should be removed in future releases
+       'GroupManager' => BSCONFIGDIR . DS . 'gm-settings.php',
+       'NamespaceManager' => BSCONFIGDIR . DS . 'nm-settings.php',
+       'PermissionManager' => BSCONFIGDIR . DS . 'pm-settings.php',
+);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8eb4d80a5d832b5bd874762d03642587576b80d0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <[email protected]>
Gerrit-Reviewer: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to