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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

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

CMS Requirements

Go to End

3 Posts   1605 Views


Community Member, 94 Posts

15 July 2007 at 2:39pm

Edited: 15/07/2007 2:43pm

we are developing pluggable modules for SS and do not want to change Requirements in CMSMain::init() everytime when the new module is installed. So I have made a (maybe not optimal) solution:

[code php]
class Config {

// put CMS Requirements here
static function CMSRequirements() {

static final function AllCMSRequirements() {
foreach (ClassInfo::subclassesFor(__CLASS__) as $class) {


In the CMSMain::init() is only:
[code php]

Each module just subclasses the Config class and fills its Requirements to the CMSRequirements method.

I know, that this is not optimal, but it has the advantage, that this code is run only when is needed, i.e. when somebody works with CMS, and not when somebody just view the pages.


Administrator, 690 Posts

16 July 2007 at 8:55pm

Creating an entire new class for this seems like overkill...

What about something like this in _config.php



Community Member, 94 Posts

17 July 2007 at 9:24am

Yeah, the new class is overkill. Your idea seems better.