Ticket #1691 (assigned enhancement)

Opened 5 years ago

Last modified 5 years ago

Filter to load modules init.php file and auto-add a SetupModule filter to the global filter chain

Reported by: biggs Assigned to: demian (accepted)
Priority: normal Milestone: 2.0
Component: not categorised Severity: open
Keywords: filterchain,setup,modules Cc:

Description

Here is an idea to load the modules init.php file. SGL1 loaded the init.php file only, but did not auto-call any filter, so you have always to alter the global filter chain by yourself. (for block and navigation for example)

To retrieve installed modules, a config value 'site.installedModules' is neccessary. Just a comma seperated list of modules in the order to be set up. (Currently only 'default'.)

In the init.php file, a filter with name 'SGL2_Filter_SetupModule' + ModuleName? is searched, and if found, is auto-added to the filter chain.

I am not sure, if you have planned any other mechanism for initializing installed modules. Perhaps you want to drop the init.php file? I really would welcome such a mechanism, so no custom filter chain is used for just setting up my modules.

Attachments

SetupModulesFilter.patch.txt (4.8 kB) - added by biggs on 11/14/08 06:35:22.

Change History

11/14/08 06:35:22 changed by biggs

  • attachment SetupModulesFilter.patch.txt added.

11/15/08 06:16:59 changed by biggs

Just another improvement: Split loading modules' init.php files and calling the setup filters. Loading the init.php files should be done quite early. The SetupModule? + ModuleName? filters should be could when output is ready (and you can add data to output, so for example, block module can add blocks array)

This split makes it possible to have custom filters still in the module's directory, but use them in the custom filter chain on demand. Does it make sense?

12/10/08 15:56:08 changed by demian

  • owner changed from somebody to demian.
  • status changed from new to assigned.

Hi Phil

These are interesting ideas, thanks for your input. I won't have time to hack on sgl2 until just before christmas but will review this stuff again when I do.