Good Afternoon MediaWiki Fans:
I see now it works just fine even with the maintenance/ directory being a symlink to the primary source. Simply use the MW_INSTALL_PATH environment:
$ cd a_symlinked_mediaWiki_copy_top_level_directory $ MW_INSTALL_PATH=`pwd` php maintenance/update.php
It now properly reads this specific LocalSettings.php file
What it was doing was determining $IP automatically in maintenance/commandLine.inc:
$IP = ( getenv('MW_INSTALL_PATH') !== false ? getenv('MW_INSTALL_PATH') : realpath( dirname( __FILE__ ) . '/..' ) );
where realpath() was resulting in the master copy source directory.
--Hiram
Michael Daly wrote:
Benjamin Lees wrote:
$wgDBname controls which database is used; you should usually set it in AdminSettings.php for maintenance scripts. You will have to set it to your first database and run update.php, then set it to your second database and run update.php, and so on (barring a more elegant method).
FWIW, my preference was to not symlink the maintenance directories and have a separate one for each wiki. Then I set up a unique AdminSettings.php in each wiki's root (renamed when not in use for minimal security). The duplicate directories need only contain the single script of interest (with all scripts in main maintenance directory in the otherwise symlinked dir structure).
This way I can run scripts without thinking too hard about making sure precisely which wiki/db the script runs against.
Mike