Reputation: 115
I am currently working on a MediaWiki extension that requires the "Arrays" extension for some features. If the array extension is not installed, my extension should give a friendly warning when trying to use said features.
How do I check if an extension is installed from within another extension?
Upvotes: 1
Views: 307
Reputation: 28200
The nice way is ExtensionRegistry::getInstance()->isLoaded( 'Arrays' )
. This only works for extensions which use extension registration (which Arrays does). Otherwise, you can just check if some class from that extension can be loaded.
Upvotes: 4