Download the PHP package gene/module-envphp-modules without Composer
On this page you can find all versions of the php package gene/module-envphp-modules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gene/module-envphp-modules
More information about gene/module-envphp-modules
Files in gene/module-envphp-modules
Package module-envphp-modules
Short Description Magento 2 module to allow enabling a module in env.php rather than config.php, useful for require-dev dependencies
License
Informations about the package module-envphp-modules
Gene_EnvphpModules
This module allows you to enable a module in app/etc/env.php rather than app/etc/config.php.
This is useful for require-dev dependencies which by default inject their module status into app/etc/config.php, but are never deployed as actual dependencies.
Benefits
This improves developer experience by preventing conflicts and changes on the app/etc/config.php, composer.json, and composer.lock files. All modules are committed in, but the module is only enabled on developer machines. This allows us to ensure dev teams are working with all the tools necessary to deliver high quality software.
This helps maintains zero downtime deployments by allowing module:config:status and setup:db:status to understand that these developer dependencies are purposefully not present, and not a cause for concern.
Installation
Usage
You may have a developer dependency like https://github.com/tddwizard/magento2-fixtures, the standard way to install is like so
This will
- Add the module in as a
require-devdependency withincomposer.json - Set
TddWizard_Fixtures => 1withinapp/etc/config.php
This module should never end upstream but it is very useful for developers and CI pipelines to have for testing, so we can flag it as enabled in env.php like so.
This will
- Set
TddWizard_Fixtures => 0withinapp/etc/config.php, so this module is never active anywhere without an override inapp/etc/env.php - Store metadata about the module under
gene_envphp_modules_configphpwithinapp/etc/config.php - Store
TddWizard_Fixtures => 1undergene_envphp_modules_envphpwithinapp/etc/env.php
From here the module will appear enabled locally and within test executions.
Performance
This module is built to have a low footprint on the code. There are 2 main extension points
Performance - Setup Commands
The setup:upgrade, setup:db:status, module:config:status are all customised via the dependency injections in setup/config/autoload/gene-envphp-modules.global.php.
In Gene\EnvphpModules\Model\DeploymentConfigReader and Gene\EnvphpModules\Model\DeploymentConfigWriter we do a series of low impact array lookups and an is_file check per module. These changes only apply to the manually invoked setup commands.
Performance - Module List
We use app/etc/gene_envphp_modules/di.xml to inject the following custom deployment configuration model into the module list
On production/staging environments there will be no development modules defined in env.php, so the only additional overhead is an if condition and a lookup of the already available deployment configuration data.