If you’re not paying attention, eBay has been a little more proactive on the Magento 2 front. The code dumps are coming regularly to git.
Of course, this means the shifts in architecture direction are also coming regularly to git.
In Magento 1 we had module declaration files. These lived in
app/etc/modules/*.xml
and “declared” a module in the system. Much like you’d edit /etc/apache2/conf/*.conf
to configure virtual hosts in a web server, you’d edit files in app/etc/modules/*.xml
to enable and disable modules in Magento.
The multiple configuration files (declaration file vs. etc/config.xml
) confused a certain class of developer, so in early versions of Magento 2 the module declaration was moved into a module’s config.xml
.
While this eliminated one extra configuration file, it did seems a little mind bending — in order to know if Magento should load a module’s configuration it needed to load a modules configuration?
Magento has addressed this in the latest builds of Magento 2. A new module configuration file, located in
app/code/Packagename/Modulename/etc/module.xml
was added to the system. This file is the new module declaration file, with a new syntax for module versions, active state, and a depends/sequence loading language. Checkout any of the default module’s module.xml
for the specifics
./app/code/Magento/Adminhtml/etc/module.xml
./app/code/Magento/AdminNotification/etc/module.xml
./app/code/Magento/Authorizenet/etc/module.xml
./app/code/Magento/Backend/etc/module.xml
./app/code/Magento/Backup/etc/module.xml
./app/code/Magento/Bundle/etc/module.xml
./app/code/Magento/Captcha/etc/module.xml
./app/code/Magento/Catalog/etc/module.xml
etc ...