Question

When we built/install new module it should have registration.php as per Magento Standard.

When we run php bin/magento setup:upgrade. Module will be installed.

How actually this command check for my custom module's registration.php & install it?

Était-ce utile?

La solution

For modules installed with composer, registration.php should be registered as autoload file in composer.json.

For local modules in "app" (which you seem to be referring to), there is app/etc/NonComposerComponentRegistration.php which itself is registered as autoloader file and looks for the following paths:

$pathList[] = dirname(__DIR__) . '/code/*/*/cli_commands.php';
$pathList[] = dirname(__DIR__) . '/code/*/*/registration.php';
$pathList[] = dirname(__DIR__) . '/design/*/*/*/registration.php';
$pathList[] = dirname(__DIR__) . '/i18n/*/*/registration.php';
$pathList[] = dirname(dirname(__DIR__)) . '/lib/internal/*/*/registration.php';
$pathList[] = dirname(dirname(__DIR__)) . '/lib/internal/*/*/*/registration.php';
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top