protected function execute(InputInterface $input, OutputInterface $output) { $module = $input->getArgument('module'); $output->writeln(sprintf('Updating %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->update($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>Update of %s failed!</error>', $module)); } else { $output->writeln(sprintf('<info>Update of %s completed.</info>', $module)); } $xoops->cache()->delete('system'); }
$module_handler = $xoops->getHandlerModule(); $block_handler = $xoops->getHandlerBlock(); $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_UPDATE); $admin_page->renderBreadcrumb(); $ret = array(); $system_module = new SystemModule(); $ret = $system_module->update($module->getVar('dirname')); $xoops->tpl()->assign('module', $ret); if ($ret) { $xoops->tpl()->assign('install', 1); $xoops->tpl()->assign('from_title', SystemLocale::MODULES_ADMINISTRATION); $xoops->tpl()->assign('from_link', $system->adminVersion('modulesadmin', 'adminpath')); $xoops->tpl()->assign('title', XoopsLocale::A_UPDATE); $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;
$xoops->cache()->delete('system/modules'); $dirnames = $xoops->setActiveModules(); /* * With multiple module installs in one pass, preload events are not refreshed in between. * One side effect is that plugins that modify configurations (specifically comments and notifications) * do not get a chance to process the install events as is needed. Here, we will loop through all * the modules supplying a plugin interface and update them, reprocessing and fixing everything. */ \Xoops\Module\Plugin::resetPluginsCache(); $xoops->setTpl(new Xoops\Core\XoopsTpl()); // update() uses this??? foreach ($dirnames as $dirname) { if ($dirname !== 'system') { if (\XoopsLoad::fileExists($xoops->path("modules/{$dirname}/class/plugin/interface.php"))) { $xoops->clearModuleConfigsCache(); $system_module->update($dirname); } } } } else { if (!$xoops->getConfig('locale')) { $xoops->setConfig('locale', $_COOKIE['xo_install_lang']); } $xoops->loadLocale('system'); include_once XOOPS_ROOT_PATH . "/modules/system/class/module.php"; include_once XOOPS_ROOT_PATH . "/modules/system/class/system.php"; $system = System::getInstance(); // Get installed modules $system_module = new SystemModule(); $dirlist = $system_module->getInstalledModules(); $toinstal = 0;