Diving deep into Magento 2 Module

Noend Magento 2

Today will focus to get a deeper understanding of Magento 2 Module generation.

For setting up a new minimum module we need a namespace a module name and a setup version. After we provided all the information we need to run Magento´s 2 cli command line tool. First we have to run bin/magento module:enable NAMESPACE_MODULENAME, next we need to run bin/magento setup:upgrade.

First let´s disect bin/magento module:enable NAMESPACE_MODULENAME.

  1. The file bin/magento can be found at MAGENTO ROOT/bin/magento:

    On line 23 we jump to MAGENTO ROOT/vendor/symfony/console/Application.php

    At line 11 we have our arguments in the array tokens

    At line 22 we go to /vendor/magento/framework/Console/Cli.php

    At line 8 we go to /vendor/symfony/console/Application.php

    At line 15 we get the commandName in our case module:enable.
    At iine 41 we call doRunCommand at /vendor/symfony/console/Application.php

    At line 10 we go to /vendor/symfony/console/Command/Command.php

    … to be continued

Leave a Reply

Your email address will not be published. Required fields are marked *

Do you need support in your project ?

Contact me