-
Notifications
You must be signed in to change notification settings - Fork 139
Description
Feature Description
As part of #656, the milestone 1 will temporarily result in certain features being available as plugins and as modules. While the Performance Lab plugin will do all it can to ensure that a module doesn't load if the similar plugin is already loaded (see #666), this approach is not and cannot be 100% reliable: For example, when you already use one of the modules, and then activate the corresponding standalone plugin, it will throw an exception during activation as it would effectively redeclare the functions from the module. This is only relevant during activation, since at that point the plugin would be loaded after the module (while normally it is the other way around).
For that reason, and as a general good practice, we should reduce each module's load.php file to just that: A file that loads other files. Additionally, we should add a clause to each load.php file to not load the files if e.g. a function or constant from that feature is already defined (e.g. in the equivalent Performance Lab module or standalone plugin).
Requirements
- All functions, classes, constants, etc. that are declared in a module's
load.phpfile should be moved to other more specific files. - Each module's
load.phpfile should include a check for whether a certain key function or constant or class that is part of the module is already loaded. If so, the file should return early. - Otherwise, all that the module
load.phpfiles should do going forward is load the other files.