Example #1
1
 /**
  * Gets application commands
  *
  * @return array
  */
 protected function getApplicationCommands()
 {
     $setupCommands = [];
     $toolsCommands = [];
     $modulesCommands = [];
     $bootstrapParam = new ComplexParameter(self::INPUT_KEY_BOOTSTRAP);
     $params = $bootstrapParam->mergeFromArgv($_SERVER, $_SERVER);
     $params[Bootstrap::PARAM_REQUIRE_MAINTENANCE] = null;
     $bootstrap = Bootstrap::create(BP, $params);
     $objectManager = $bootstrap->getObjectManager();
     if (class_exists('Magento\\Setup\\Console\\CommandList')) {
         $serviceManager = \Zend\Mvc\Application::init(require BP . '/setup/config/application.config.php')->getServiceManager();
         $setupCommandList = new \Magento\Setup\Console\CommandList($serviceManager);
         $setupCommands = $setupCommandList->getCommands();
     }
     if (class_exists('Magento\\Tools\\Console\\CommandList')) {
         $toolsCommandList = new \Magento\Tools\Console\CommandList();
         $toolsCommands = $toolsCommandList->getCommands();
     }
     if ($objectManager->get('Magento\\Framework\\App\\DeploymentConfig')->isAvailable()) {
         $commandList = $objectManager->create('Magento\\Framework\\Console\\CommandList');
         $modulesCommands = $commandList->getCommands();
     }
     $commandsList = array_merge($setupCommands, $toolsCommands, $modulesCommands);
     return $commandsList;
 }
Example #2
0
    /**
     * Gets application commands
     *
     * @return array
     */
    protected function getApplicationCommands()
    {
        $setupCommands   = [];
        $modulesCommands = [];

        $bootstrapParam = new ComplexParameter(self::INPUT_KEY_BOOTSTRAP);
        $params = $bootstrapParam->mergeFromArgv($_SERVER, $_SERVER);
        $params[Bootstrap::PARAM_REQUIRE_MAINTENANCE] = null;
        $bootstrap = Bootstrap::create(BP, $params);
        $objectManager = $bootstrap->getObjectManager();
        /** @var \Magento\Setup\Model\ObjectManagerProvider $omProvider */
        $omProvider = $this->serviceManager->get('Magento\Setup\Model\ObjectManagerProvider');
        $omProvider->setObjectManager($objectManager);

        if (class_exists('Magento\Setup\Console\CommandList')) {
            $setupCommandList = new \Magento\Setup\Console\CommandList($this->serviceManager);
            $setupCommands = $setupCommandList->getCommands();
        }

        if ($objectManager->get('Magento\Framework\App\DeploymentConfig')->isAvailable()) {
            /** @var \Magento\Framework\Console\CommandList $commandList */
            $commandList = $objectManager->create('Magento\Framework\Console\CommandList');
            $modulesCommands = $commandList->getCommands();
        }

        $vendorCommands = $this->getVendorCommands($objectManager);

        $commandsList = array_merge(
            $setupCommands,
            $modulesCommands,
            $vendorCommands
        );

        return $commandsList;
    }
Example #3
0
 /**
  * Gets application commands
  *
  * @return array
  */
 protected function getApplicationCommands()
 {
     $commands = [];
     try {
         $bootstrapParam = new ComplexParameter(self::INPUT_KEY_BOOTSTRAP);
         $params = $bootstrapParam->mergeFromArgv($_SERVER, $_SERVER);
         $params[Bootstrap::PARAM_REQUIRE_MAINTENANCE] = null;
         $bootstrap = Bootstrap::create(BP, $params);
         $objectManager = $bootstrap->getObjectManager();
         /** @var \Magento\Setup\Model\ObjectManagerProvider $omProvider */
         $omProvider = $this->serviceManager->get('Magento\\Setup\\Model\\ObjectManagerProvider');
         $omProvider->setObjectManager($objectManager);
         if (class_exists('Magento\\Setup\\Console\\CommandList')) {
             $setupCommandList = new \Magento\Setup\Console\CommandList($this->serviceManager);
             $commands = array_merge($commands, $setupCommandList->getCommands());
         }
         if ($objectManager->get('Magento\\Framework\\App\\DeploymentConfig')->isAvailable()) {
             /** @var \Magento\Framework\Console\CommandListInterface */
             $commandList = $objectManager->create(\Magento\Framework\Console\CommandListInterface::class);
             $commands = array_merge($commands, $commandList->getCommands());
         }
         $commands = array_merge($commands, $this->getVendorCommands($objectManager));
     } catch (\Exception $e) {
         $this->initException = $e;
     }
     return $commands;
 }