/** * @inheritdoc */ protected function interact(InputInterface $input, OutputInterface $output) { parent::interact($input, $output); $module = new Module($input->getArgument('module')); if (in_array($this->getName(), ['module:register', 'module:unregister']) && $module->isThirdParty() && !$input->getOption('confirm-thirdparty')) { $output->writeln($module->isThirdParty() . ' is not a kernel module. Correct operation cannot be guaranteed for third-party modules!'); } }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $module = new Module($input->getArgument('module')); if (!$module->isThirdParty()) { $output->writeln('<info>Loading kernel modules is unsupported</info>'); } if ($input->getOption('beta')) { $module->setBeta(); } $module->load(); if (!$input->getOption('no-update')) { $modulesUpdated = null; while ($module->update($modulesUpdated)) { if (is_array($modulesUpdated)) { foreach ($modulesUpdated as $moduleName => $moduleVersion) { $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion)); } } return $this->restartScript($input, $output); } } if (!$input->getOption('no-register')) { try { $module->register(); } catch (ModuleInstallException $e) { $output->writeln(sprintf('<comment>%s</comment>', $e->getMessage()), OutputInterface::VERBOSITY_VERBOSE); $output->writeln(sprintf('Module loaded, but <error>not registered</error>. You need to do it yourself in admin panel.', $module->getName())); } } $output->writeln(sprintf('installed <info>%s</info>', $module->getName())); return 0; }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $module = new Module($input->getArgument('module')); $modulesUpdated = null; while ($module->update($modulesUpdated)) { if (is_array($modulesUpdated)) { foreach ($modulesUpdated as $moduleName => $moduleVersion) { $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion)); } } return $this->restartScript($input, $output); } return 0; }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $module = new Module($input->getArgument('module')); $module->unRegister(); $output->writeln(sprintf('unregistered <info>%s</info>', $module->getName())); }