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?

有帮助吗?

解决方案

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';
许可以下: CC-BY-SA归因
scroll top