Last modified: 2007-07-10 11:10:45 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 T10584, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8584 - Built-in documentation for ExpandTemplates.php needs to mention requirement on ExtensionFunctions.php
Built-in documentation for ExpandTemplates.php needs to mention requirement o...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
ExpandTemplates (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://svn.wikimedia.org/viewvc/media...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-11 18:07 UTC by Jason Armistead
Modified: 2007-07-10 11:10 UTC (History)
1 user (show)

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


Attachments

Description Jason Armistead 2007-01-11 18:07:03 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.
Comment 1 Rob Church 2007-01-11 18:11:42 UTC
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.
Comment 2 Rob Church 2007-07-10 11:06:25 UTC
Documentation updated in r. It seems that the extension operates in a compatibility mode for older versions, so the dependency is theoretically valid.
Comment 3 Rob Church 2007-07-10 11:10:45 UTC
That's r23949.

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


Navigation
Links