Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37045450
en ru br
ALT Linux repos
S:1.40.0-alt1
D:1.13.0-alt1
5.0: 1.13.0-alt3
4.1: 1.13.0-alt2.M41.2
4.0: 1.13.0-alt2.M40.1
+backports:1.13.0-alt2.M40.1

Group :: Networking/WWW
RPM: mediawiki

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: mediawiki-1.40-config-path.patch
Download


diff --git a/mediawiki/includes/BootstrapHelperFunctions.php b/mediawiki/includes/BootstrapHelperFunctions.php
index c8dc6f940..bf9ae66c0 100644
--- a/mediawiki/includes/BootstrapHelperFunctions.php
+++ b/mediawiki/includes/BootstrapHelperFunctions.php
@@ -41,7 +41,7 @@ function wfDetectLocalSettingsFile( ?string $installationPath = null ): string {
 	// place is dangerous, so better not to encourage that.
 	// In order to use LocalSettings.yaml and LocalSettings.json, they
 	// will have to be referenced explicitly by MW_CONFIG_FILE.
-	$configFile = getenv( 'MW_CONFIG_FILE' ) ?: "LocalSettings.php";
+	$configFile = getenv( 'MW_CONFIG_FILE' ) ?: "$installationPath/config/LocalSettings.php";
 	// Can't use str_contains because for maintenance scripts (update.php, install.php),
 	// this is called *before* Setup.php and vendor (polyfill-php80) are included.
 	if ( strpos( $configFile, '/' ) === false ) {
diff --git a/mediawiki/includes/Setup.php b/mediawiki/includes/Setup.php
index 003544c72..4ce788a43 100644
--- a/mediawiki/includes/Setup.php
+++ b/mediawiki/includes/Setup.php
@@ -207,6 +207,16 @@ try {
 				// make defaults available as globals
 				$wgSettings->apply();
 				require_once MW_CONFIG_FILE;
+
+				// ALT specific loading configs from packages
+				// Include all PHP files in config/LocalSettings.d/ directory
+				$configDir = preg_replace('/(.*).php/', '$1.d', MW_CONFIG_FILE);
+				if (is_dir($configDir)) {
+					foreach (glob($configDir . "/*.php") as $d_config) {
+						require_once($d_config);
+					}
+				}
+
 			} else {
 				$wgSettings->loadFile( MW_CONFIG_FILE );
 			}
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin