protected function execute(InputInterface $input, OutputInterface $output)
 {
     $module = $input->getArgument('module');
     $output->writeln(sprintf('Uninstalling %s', $module));
     $xoops = \Xoops::getInstance();
     if (false === $xoops->getModuleByDirname($module)) {
         $output->writeln(sprintf('<error>%s is not an installed module!</error>', $module));
         return;
     }
     $xoops->setTpl(new \XoopsTpl());
     \XoopsLoad::load('module', 'system');
     $sysmod = new \SystemModule();
     $result = $sysmod->uninstall($module);
     foreach ($sysmod->trace as $message) {
         if (is_array($message)) {
             foreach ($message as $subMessage) {
                 if (!is_array($subMessage)) {
                     $output->writeln(strip_tags($subMessage));
                 }
             }
         } else {
             $output->writeln(strip_tags($message));
         }
     }
     if ($result === false) {
         $output->writeln(sprintf('<error>Uninstall of %s failed!</error>', $module));
     } else {
         $output->writeln(sprintf('<info>Uninstall of %s completed.</info>', $module));
     }
     $xoops->cache()->delete('system');
 }
Example #2
0
     $mid = $system->cleanVars($_POST, 'mid', 0, 'int');
     $module_handler = $xoops->getHandlerModule();
     $module = $module_handler->getById($mid);
     // Call Header
     $xoops->header('admin:system/system_modules_logger.tpl');
     // Define Stylesheet
     $xoops->theme()->addStylesheet('modules/system/css/admin.css');
     // Define Breadcrumb and tips
     $admin_page = new \Xoops\Module\Admin();
     $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true);
     $admin_page->addBreadcrumbLink(SystemLocale::MODULES_ADMINISTRATION, $system->adminVersion('modulesadmin', 'adminpath'));
     $admin_page->addBreadcrumbLink(XoopsLocale::A_UNINSTALL);
     $admin_page->renderBreadcrumb();
     $ret = array();
     $system_module = new SystemModule();
     $ret = $system_module->uninstall($module->getVar('dirname'));
     $xoops->tpl()->assign('module', $ret);
     if ($ret) {
         $xoops->tpl()->assign('from_title', SystemLocale::MODULES_ADMINISTRATION);
         $xoops->tpl()->assign('from_link', $system->adminVersion('modulesadmin', 'adminpath'));
         $xoops->tpl()->assign('title', XoopsLocale::A_UNINSTALL);
         $xoops->tpl()->assign('log', $system_module->trace);
     }
     $folder = array(1, 2, 3);
     $system->cleanCache($folder);
     //Set active modules in cache folder
     $xoops->setActiveModules();
     // Call Footer
     $xoops->footer();
     break;
 case 'update':