Last modified: 2011-08-24 21:58:33 UTC
Executing (trunk 1.19alpha, -r93922): cd /var/www/v-species/w; # one of the wiki folder sudo php ./extensions/GlobalUsage/refreshGlobalimagelinks.php --conf ./LocalSettings.php fails with: Warning: require_once(../../maintenance/Maintenance.php): failed to open stream: No such file or directory in /usr/share/mediawiki/extensions/GlobalUsage/refreshGlobalimagelinks.php on line 12 Fatal error: require_once(): Failed opening required '../../maintenance/Maintenance.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/mediawiki/extensions/GlobalUsage/refreshGlobalimagelinks.php on line 12 The code sets: $path = '../..'; require_once( $path . '/maintenance/Maintenance.php' ); which cannot work if extension, maintenance, etc. folders are symlinks in all wikis, pointing to the same code base. This is a frequent mediawiki setup and supported by mediawiki core by means of the --conf parameter available in all maintenance scripts. Please implement this in GlobalUsage as well. Note 1: sudo php ./maintenance/sql.php ./extensions/GlobalUsage/GlobalUsage.sql --conf ./LocalSettings.php works ok Note 2: Calling Maintenance.php, which handles the --conf parameter does work with: "require_once( dirname( __FILE__ ) . '/../../maintenance/Maintenance.php' );" which is pretty close to the above. However, then the error is that Class GlobalUsage cannot be found. Note 3: SMW updating (SMW_refreshData.php) works OK in our setup. They call require_once ( getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) . "/maintenance/commandLine.inc" : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' ); If put into the GlobalUsage code, replacing the call of Maintenance.php, this produces no longer any errors. However, Global Usage did not work after this yet, we may have more problems (unclear yet).
r95419 should fix this -- switched it from working-directory-relative "../.." default to dirname(dirname(dirname(___FILE___))) for the standard directory structure. The MW_INSTALL_PATH environment variable should have already worked. (Note that a --conf parameter doesn't help you find the location of MediaWiki's scripts in the first place! You must set MW_INSTALL_PATH env variable for that.)
I confirm that is works ok, thank you! Please _backport_ this to Rel 1.18, so it becomes directly usable. (Note: like with all other core maintenance scripts, or TitleKey, MW_INSTALL_PATH is not necessary with a wikifarm based on symlinks, i.e. each wiki folder contains cache, media, LocalSettings locally, with all other folders and files present only as a symlink.)