Question

I'm working on a solution that requires adding a bit of functionality to the magento installation process. How do I override a file in root/setup/src/Magento/...

How would i override setup/src/Magento/Setup/Model/Installer.php?

No correct solution

OTHER TIPS

I am not sure you can do this in Magento directly. But composer may be of some assistance.

...
"autoload": {
    ...
    "files": [
        "app/etc/NonComposerComponentRegistration.php",
        "setup/src/My/Setup/Model/Installer.php"
    ],
    "exclude-from-classmap": [
        "**/dev/**",
        "**/update/**",
        "**/Test/**",
        "setup/src/Magento/Setup/Model/Installer.php"
    ]
}
...

The files array tells composer to load those files first. The exclude-from-classmap array tells composer to not load the file at all. So don't load the core file, copy it somewhere, make your modifications, and load your new file.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top