17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1272 Views |
-
Detecting module exists

8 June 2007 at 11:37am
Some of the code requires knowing if a module has been loaded or not.
For instance, soon the forum module will need to ask
If ( google-mapping-module-installed ) {
google-mapping-module->ShowSomeMap
}Hayden, can you please add this system?
a) Consult Sam to see about this thinking on it
b) Note that Andrew is working on related code that only loads modules if a _config.php exists See my top post at http://www.silverstripe.com/core-team-discussion/flat/1202/ -
Re: Detecting module exists

10 June 2007 at 3:53pm
Simplest solution here is to use class_exists, on the relevant class within that module.
For example:
if(class_exists('GoogleMapField')) {
$fields->addFieldToTab(new GoogleMapField());
} else {
$fields->addFieldToTab(new TextField());
} -
Re: Detecting module exists

10 June 2007 at 8:01pm
now that we (and external developers) start building modules/plugins, we should think about setting up a basic plugin architecture with hooks into core functionality. some reasons:
- module developers are not dependent on core changes if the right hooks are existing (e.g. to add cmsfields to the standard page-object)
- API changes in module/core don't impact each other heavily
- module developers can release updates independently of the core release cycle
- the core stays cleaner and is easier to debugwe need to think on a broader level here, because we're laying the foundations for future module development. if we just write ad-hoc solutions (hacks?) into sapphire/cms, it just creates more problems on the long run.
matt had some thoughts on this as well, and it might fall in the scope of his GSOC project (mashups).
| 1272 Views | ||
|
Page:
1
|
Go to Top |



