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,

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

.... like that

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


Magento has a sample for this.


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.