protected function execute(InputInterface $input, OutputInterface $output) { try { $key = $input->getArgument('key'); $service = new ModuloService($this->em); $service->uninstall($key); $output->writeln("<info>Módulo desinstalado com sucesso</info>"); } catch (Exception $e) { $output->writeln("<error>{$e->getMessage()}</error>"); } }
protected function execute(InputInterface $input, OutputInterface $output) { try { $filename = $input->getArgument('filename'); $service = new ModuloService($this->em); if (is_dir($filename)) { $key = $input->getArgument('key'); if (empty($key)) { throw new Exception('Ao instalar a partir de um diretório, deve especificar a chave do módulo'); } $service->install($filename, $key); } else { $service->extractAndInstall($filename); } $output->writeln('<info>Módulo instalado com sucesso</info>'); } catch (Exception $e) { $output->writeln("<error>{$e->getMessage()}</error>"); } }
public function delete(Context $context, $id) { $modulo = $this->find($id); $service = new ModuloService($this->em()); $service->uninstall($modulo->getChave()); $this->app()->redirect("{$context->request()->getRootUri()}/modules/sga.modulos"); }