Details about the deployment configuration
config.php
and env.php
are PHP files that return a multi-dimensional associative array, which is basically a hierarchical arrangement of configuration parameters and values.
On the top level of this array are configuration segments. A segment has arbitrary content (a scalar value or a nested array) distinguished by an arbitrary key—where both the key and value pair are defined by the Commerce framework.
Magento\Framework\App\DeploymentConfig merely provides access to these sections but does not allow you to extend them.
On the next hierarchy level, items in each segment are ordered according to the module sequence definition, which is obtained by merging all modules’ configuration files, except for disabled modules.
The following sections discuss the structure and contents of the deployment configuration:
- Manage installed modules
- System-specific configuration
Manage installed modules
The config.php
file contains a list of installed modules. Adobe Commerce provides both command-line and web-based utilities to manage modules (install, uninstall, enable, disable, or upgrade).
Examples:
- Uninstall components:
bin/magento setup:uninstall
- Check status of components:
bin/magento module:status
- Enable or disable components:
bin/magento module:disable
,bin/magento module:enable
.
config.php
return array (
'modules' =>
array (
'Magento_Core' => 1,
'Magento_Store' => 1,
'Magento_Theme' => 1,
'Magento_Authorization' => 1,
'Magento_Directory' => 1,
'Magento_Backend' => 1,
'Magento_Backup' => 1,
'Magento_Eav' => 1,
'Magento_Customer' => 1,
...
),
);
The value 1
or 0
indicates whether a module is enabled or disabled.
Disabled modules are not recognized by the Commerce application; in other words, they do not participate in merging configuration, in dependency injection, events, plug-ins, and so on. Disabled modules do not modify the storefront or Admin and do not affect routing.
The only practical difference of a disabled module and an absent module in the code base is that a disabled module is found by the autoloader, and its classes and constants are available for reuse in other code.