Can MediaWiki Install Script be modified to handle a shared extensions directory link?

Initial forum post here: http://virtualmin.com/node/35947

Status: 
Active

Comments

Can the extensions directory by set in the MediaWiki config file? If so, it could point directly to the shared location, rather than using a symlink.

Joe's picture
Submitted by Joe on Fri, 01/23/2015 - 23:58 Pro Licensee

It does not appear to be configurable, at least not independently. The way enabling extensions in MediaWiki works is to include something like the following in LocalSettings.php:

require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php";

Where $IP is set somewhere in the code (not in the config file), and is also depended on by several other options. And, this is kinda standard across all MediaWiki installs and docs. I think altering it with a different path would be very error prone, though I guess it would be possible to define a new "$EXT" variable or something inside the config file. But, that would have to happen across all MediaWiki installs.

You could maybe change that line to something like :

require_once "/usr/local/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php";

However, if the extension refers to any images that it expects to find at the /extensions URL path, that won't work.

I don't have any other good solution unfortunately, as the Virtualmin script upgrade process just extracts the tar or ZIP file in the destination directory, which will fail if a file or directory cannot be over-written.