Last modified: 2007-07-10 11:10:45 UTC
Top of file says: if ( !defined( 'MEDIAWIKI' ) ) { ?> <p>This is the ExpandTemplates extension. To enable it, put </p> <pre>require_once("$IP/extensions/ExpandTemplates/ExpandTemplates.php");</pre> <p>at the bottom of your LocalSettings.php</p> <?php exit(1); } BUT what is missing is the fact that it also calls upon ExtensionFunctions.php which is NOT part of the standard MediaWiki distribution tree. This should be included in that documentation section somehow. And, should ExtensionFunctions.php be part of the MediaWiki distribution tree (not an optional download). The statement if ( !function_exists( 'extAddSpecialPage' ) ) { require( dirname(__FILE__) . '/../ExtensionFunctions.php' ); } Fails spectacularly because ExtensionFunctions.php is not available. Perhaps that "require" statement should also look like require("$IP/extensions/ExtensionFunctions.php"); So that it is all referenced relative to the MediaWiki install point "$IP" rather than to the extension itself, which would still give it the same path but look "cleaner" in the code. And, should it be a "require" or a "require_once" that is used in this case ? If other extensions rely on ExtensionFunctions.php, do we need to "require" it each and every time ? That sounds like a recipe for trouble.
I viewed ExtensionFunctions.php with some dislike then, and I still do now, except now, it's likely not needed. The extension in question, ExpandTemplates, uses some parser method which I don't think existed before 1.7, so we hardly need the class autoloading compatibility stuff in it. I personally prefer to minimise external dependencies when making things backwards compatible, c.f. the NewestPages extension.
Documentation updated in r. It seems that the extension operates in a compatibility mode for older versions, so the dependency is theoretically valid.
That's r23949.