Last modified: 2011-08-24 21:58:33 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 T32540, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30540 - refreshGlobalimagelinks.php ignores --conf ./LocalSettings.php, failing on wiki farm with symlinks
refreshGlobalimagelinks.php ignores --conf ./LocalSettings.php, failing on wi...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
GlobalUsage (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-24 09:39 UTC by Gregor Hagedorn
Modified: 2011-08-24 21:58 UTC (History)
1 user (show)

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


Attachments

Description Gregor Hagedorn 2011-08-24 09:39:08 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).
Comment 1 Brion Vibber 2011-08-24 19:19:22 UTC
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.)
Comment 2 Gregor Hagedorn 2011-08-24 21:58:33 UTC
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.)

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


Navigation
Links