From 1873fa94f309b4acc2c16eea2b26387d540ae55f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 Jun 2016 17:13:54 +0200 Subject: Add documentation --- doc/module-dependencies | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/module-dependencies (limited to 'doc/module-dependencies') diff --git a/doc/module-dependencies b/doc/module-dependencies new file mode 100644 index 00000000..3da27b16 --- /dev/null +++ b/doc/module-dependencies @@ -0,0 +1,31 @@ +Modules can define other modules as dependencies. You should do this +whenever you require resources (like database tables) that belong +to module A in module B, if you want to use automatic css/js +inclusion (see javascript_css doc), or if you just feel like your +module should not be accessible if another module is not present. + +"baseconfig_partitions_cdn" has "baseconfig" as a dependency; it +does not directly access any tables of the module "baseconfig", but +since it depends on the getconfig-API of the baseconfig module, one +might argue that having the partition setup feature is of limited +use if the clients can't fetch it. + +"statistics" module has "js_chart" as a dependency, since it +makes use of the automatic clientscript.js inclusion. The statistics +module uses the chart javascript library to draw, well, charts. + + +You can write modules that can optionally interact or take advantage +of other modules if they are present. The statistics module can +make use of the locations module to show which location a client +belongs to, but it would still work without the locations module +being present. You can check for the availability of a module +by calling Module::isAvailable('') +If the module is available, the call will return true, and +the class autoloader for the requested module is also installed, +so you can use any classes from ./modules//inc/*.inc.php +Again, see how the statistics module calls Location::getFromIp() +and other functions after calling Module::isAvailable(). +If you'd try to access Location::* without doing so, you'd get +a class not found error. + -- cgit v1.2.3-55-g7522