"Roan Kattouw" roan.kattouw@home.nl wrote in message news:480F1B00.5090804@home.nl...
Simetrical schreef:
On Tue, Apr 22, 2008 at 5:59 PM, Mark Clements
gmane@kennel17.co.uk wrote:
And, of course, it doesn't help when that's not the case, which is the situation for us. For technical reasons, all extensions are outside
the MW
source folder entirely.
Symlinks work perfectly in that case (as is true for my localhost, for instance, since it's running a checked-out version of mediawiki/trunk/). I agree it's not great practice, though: maybe you could try to use the current working directory? That seems even less reliable.
The point is I gotta require_once() /maintenance/commandLine.inc or whatever it's called. Of course, creating a symlink to commandLine.inc (or copying it around if you're on Windows) will solve that.
From an extension writer's point of view, the current situation is to put in
a relative require_once() line to commandLine.inc and hope that the file is in the expected place. You are then dependent on the user having set things up 'correctly' on their server, and either let PHP throw whatever messages it throws if it isn't, or add a load of checks to the system. The symlink solution is not something that the writer can rely on. It is also not terribly convenient if your extensions are in ~/mw_extensions to have to create a ~/maintenance symlink, and probably a ~/AdminSettings.php symlink as well - that's a lot of clutter in your home directory!
What would be better would be if extension writers could simply stick the following code at the top of their maintenance scripts:
if (!defined("MEDIAWIKI") || !$wgCommandLine) die("Maintenence scripts should be run from your wiki's maintenance folder, using updateExtension.php");
updateExtension.php would do all the necessary checks and inclusions that extensions will need (DB connection, LocalSettings, setting up paths, etc.) so you, as an extension writer, don't have to worry about this side of things at all.
- Mark Clements (HappyDog)