Hi,
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) {
eval("$class::CMSRequirements();");
}
}
}
In the CMSMain::init() is only:
[code php]
Config::AllCMSRequirements()
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.