Last modified: 2007-06-15 00:43:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T11058, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9058 - Multiple LocalSettings.php with single codebase fails in update.php
Multiple LocalSettings.php with single codebase fails in update.php
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-21 21:49 UTC by David Multer
Modified: 2007-06-15 00:43 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patches maintenance/update.php to add --aconf option (1.39 KB, patch)
2007-02-21 21:51 UTC, David Multer
Details

Description David Multer 2007-02-21 21:49:53 UTC
Perform an install using a single codebase with symlinks to multiple install directories, each with separate LocalSettings.php, AdminSettings.php, and 
images and extensions directories as described here:

http://meta.wikimedia.org/wiki/MediaWiki_FAQ#Is_it_possible_to_install_more_than_one_wiki_.28MediaWiki.29_on_a_server.3F_How.3F

When performing an update to a new version, the maintenance/update.php script fails due to assumption that LocalSettings.php and AdminSettings.php 
are in the same root MediaWiki path as the update.php script.

The following is a unified diff of the changes that need to be performed to fix the file. This fix adds an additional --aconf command line option to specify 
the location of the AdminSettings.php file. Combined with the use of the existing --conf option, the update.php script will complete successfully.

--- commandLine.inc.original    2007-02-21 13:31:07.000000000 -0800
+++ commandLine.inc.new 2007-02-21 13:36:54.000000000 -0800
@@ -34,7 +34,10 @@
 if ( !isset( $optionsWithArgs ) ) {
        $optionsWithArgs = array();
 }
-$optionsWithArgs[] = 'conf'; # For specifying the location of LocalSettings.php
+# For specifying the location of:
+#  LocalSettings.php (conf)
+#  AdminSettings.php (aconf)
+$optionsWithArgs = array( 'conf', 'aconf' );
 
 $self = array_shift( $argv );
 $IP = realpath( dirname( __FILE__ ) . '/..' );
@@ -169,6 +172,11 @@
        } else {
                $settingsFile = "$IP/LocalSettings.php";
        }
+        if ( isset( $options['aconf'] ) ) {
+                $aSettingsFile = $options['aconf'];
+        } else {
+                $aSettingsFile = "$IP/AdminSettings.php";
+        }
 
        if ( ! is_readable( $settingsFile ) ) {
                print "A copy of your installation's LocalSettings.php\n" .
@@ -182,9 +190,9 @@
        require_once( $settingsFile );
        ini_set( 'include_path', ".$sep$IP$sep$IP/includes$sep$IP/languages$sep$IP/maintenance" );
 
-       if ( is_readable( $IP.'/AdminSettings.php' ) ) {
-               require_once( $IP.'/AdminSettings.php' );
-       }
+        if ( is_readable( $aSettingsFile ) ) {
+                require_once( $aSettingsFile );
+        }
 }
 
 # Turn off output buffering again, it might have been turned on in the settings files
Comment 1 David Multer 2007-02-21 21:51:28 UTC
Created attachment 3255 [details]
Patches maintenance/update.php to add --aconf option
Comment 2 Rob Church 2007-06-08 18:09:52 UTC
Patch overwrites $optionsWithArguments, would break existing scripts.
Comment 3 Rob Church 2007-06-08 18:12:20 UTC
'aconf' option added in r22845.
Comment 4 Brion Vibber 2007-06-11 18:45:16 UTC
The --aconf option appears to be redundant to --conf; I would recommend backing this out and simply fixing it.
Comment 5 David Multer 2007-06-15 00:43:44 UTC
FYI - I originally thought it was better to introduce a new option variable as some installs could possibly assume that --conf would only specify a location for LocalSettings.php and depend on AdminSettings.php being in the old location. It's your call which way is better. Both work for me.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links