At the moment, consumers of MB core set MODULE_BUILDER_ENV, and then various parts of MB core use that to figure out what to so, such as:

- how to load .inc files
- where to find the hook data folder

Currently, we have two cases, 'module' and 'drush'. #2046909: separate UI modules: module builder as a library is about to add a third (though it will also remove the 'module' case).

It might be an idea to switch instead to having the consumer pass in things like the module folder, and maybe the name of a callback to load include files (alternatively, core can just build a path from __FILE__).

This could either be done with a module_builder_init() sort of function, which consumers are expected to call, or with a new MB class, which would get the data in its constructor.

Comments

joachim’s picture

Status: Active » Fixed

Done.

We now have environment handler classes, which take care of everything that is specific to whether we're in Drupal / Drush / library.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.