0

Is there a way to access command line parameters from inside the magento installer routines? I'm attempting to set up a few custom variables representing our current environment (dev / test / prod) etc. I was hoping to pass this in to the command line.

Like this...

public function install(
            \Magento\Framework\Setup\ModuleDataSetupInterface $setup,
            \Magento\Framework\Setup\ModuleContextInterface $context,
            \SOMETHING\INJECTED\FOR\COMMAND\LINE $cmdLine)
        {

            $setup->startSetup();
            // DO MY STUFF
            if ($cmdLine->getEnv() == "DEV") {

.... like that

I'm going back to search. Google is not cooperating right now ;)

0

Magento has a sample for this.

https://github.com/magento/magento2-samples/tree/master/sample-module-command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.