Exemple #1
0
 /**
  * Try to bootstrap magento 2 and load cli application
  */
 protected function registerMagentoCoreCommands()
 {
     if ($this->getMagentoRootFolder()) {
         // Magento was found -> register core cli commands
         require_once $this->getMagentoRootFolder() . '/app/bootstrap.php';
         $coreCliApplication = new \Magento\Framework\Console\Cli();
         $coreCliApplicationCommands = $coreCliApplication->all();
         foreach ($coreCliApplicationCommands as $coreCliApplicationCommand) {
             $this->add($coreCliApplicationCommand);
         }
     }
 }
Exemple #2
0
 /**
  * Try to bootstrap magento 2 and load cli application
  *
  * @param OutputInterface $output
  */
 protected function registerMagentoCoreCommands(OutputInterface $output)
 {
     if ($this->getMagentoRootFolder()) {
         // Magento was found -> register core cli commands
         require_once $this->getMagentoRootFolder() . '/app/bootstrap.php';
         $coreCliApplication = new \Magento\Framework\Console\Cli();
         $coreCliApplicationCommands = $coreCliApplication->all();
         foreach ($coreCliApplicationCommands as $coreCliApplicationCommand) {
             if (OutputInterface::VERBOSITY_DEBUG <= $output->getVerbosity()) {
                 $output->writeln(sprintf('<debug>Add core command </debug> <info>%s</info> -> <comment>%s</comment>', $coreCliApplicationCommand->getName(), get_class($coreCliApplicationCommand)));
             }
             $this->add($coreCliApplicationCommand);
         }
     }
 }