Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Module detection


Go to End


2 Posts   1728 Views

Avatar
r0nn1ef

Community Member, 6 Posts

9 February 2011 at 3:58am

I've worked with SilverStripe on several non-production sites just trying to learn the system. I've created a few modules from scratch and incorporated those within the site with no problem. One thing I have run into several times is needing a way to detect if a particular module is installed.

Is there a "SilverStripe way" of doing this? Something along the lines of Controller::moduleExists('module_name')? It seems like this should be a fairly common need from SS developers so I'm hoping someone has a simple method to do module detection.

Avatar
swaiba

Forum Moderator, 1899 Posts

9 February 2011 at 5:26am

how about...

if (ClassInfo::exists('classdefinedinmodule')) {
//module exists, do stuff...
}