Christensen, Courtney wrote:
-----Original Message----- From: mediawiki-l-bounces-RusutVdil2icGmH+5r0DM0B+6BGkLq7r@public.gmane.org [mailto:mediawiki-l-bounces-RusutVdil2icGmH+5r0DM0B+6BGkLq7r@public.gmane.org] On Behalf Of Platonides Sent: Thursday, July 10, 2008 6:19 PM To: mediawiki-l-RusutVdil2icGmH+5r0DM0B+6BGkLq7r@public.gmane.org Subject: Re: [Mediawiki-l] advice on telling wiki: Don't run extension if MWversion 1.13
Christensen, Courtney wrote:
What is a good way to not load the extension if the wiki version is high enough? Right now I am using
the
inaccurate if (function_exists( 'wfLoadExtensionMessages' )) { return true; }
P > What about checking the global variable $wgVersion ?
I tried that, but I couldn't get $wgVersion to be declared at the top of the file. I'm trying to do a check like the if (!defined(MEDIAWIKI)) at the top of the file so the extension isn't loaded at all if it isn't needed. I'm not sure why $wgVersion was giving me problems outside a function, but it was.
What's wrong with using an ExtensionFunction, that's what they are meant for?
$wgExtensionFunctions[] = 'efPAGESINCAT'; function efPAGESINCAT() { if( in_array(pagesincategory, MagicWord::$mVariableIDs) ) return; ...code here... }