Reaper Music
Reaper Music

Reputation: 115

How do I check if a MediaWiki extension is installed from within another extension?

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

Answers (1)

Tgr
Tgr

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

Related Questions