23 include __DIR__ .
'/header.php';
29 $op =
$system->cleanVars($_REQUEST,
'op',
'list',
'string');
32 $xoops->header(
'admin:maintenance/maintenance_center.tpl');
45 $form->getMaintenance();
49 case 'maintenance_save':
51 if (!
$xoops->security()->check()) {
52 $xoops->redirect(
'center.php', 3, implode(
'<br />',
$xoops->security()->getErrors()));
57 $session =
$system->cleanVars($_REQUEST,
'session', 1,
'int');
58 $cache =
$system->cleanVars($_REQUEST,
'cache', array(),
'array');
59 $tables =
$system->cleanVars($_REQUEST,
'tables', array(),
'array');
60 $tables_op =
$system->cleanVars($_REQUEST,
'maintenance', array(),
'array');
65 $res_cache =
$system->CleanCache($cache);
67 for (
$i = 0;
$i < count($cache); ++
$i) {
70 $xoops->tpl()->assign(
'smarty_cache',
true);
75 $xoops->tpl()->assign(
'smarty_compile',
true);
80 $xoops->tpl()->assign(
'xoops_cache',
true);
89 $result = $db->queryF(
'TRUNCATE TABLE ' . $db->prefix(
'session'));
90 $result ? $result_session =
true : $result_session =
false;
91 $xoops->tpl()->assign(
'result_session', $result_session);
92 $xoops->tpl()->assign(
'session',
true);
95 if (!empty($tables) && !empty($tables_op)) {
97 for ($i = 0; $i < 4; ++
$i) {
101 for ($i = 0; $i < 4; ++
$i) {
102 if (in_array($tab[$i], $tables_op)) {
103 $tab1[
$i] = $tab[
$i];
109 for ($i = 0; $i < count($tables); ++
$i) {
110 $result_arr[
'table'] = $db->prefix . $tables[
$i];
111 for (
$j = 0;
$j < 4; ++
$j) {
115 $result = $db->queryF(
'OPTIMIZE TABLE ' . $db->prefix . $tables[$i]);
116 $result ? $result_arr[
'optimize'] =
true : $result_arr[
'optimize'] =
false;
121 $result = $db->queryF(
'CHECK TABLE ' . $db->prefix . $tables[$i]);
122 $result ? $result_arr[
'check'] =
true : $result_arr[
'check'] =
false;
127 $result = $db->queryF(
'REPAIR TABLE ' . $db->prefix . $tables[$i]);
128 $result ? $result_arr[
'repair'] =
true : $result_arr[
'repair'] =
false;
133 $result = $db->queryF(
'ANALYZE TABLE ' . $db->prefix . $tables[$i]);
134 $result ? $result_arr[
'analyse'] =
true : $result_arr[
'analyse'] =
false;
138 $xoops->tpl()->appendByRef(
'result_arr', $result_arr);
141 $xoops->tpl()->assign(
'maintenance',
true);
const _AM_MAINTENANCE_CENTER_RESULT_SMARTY_CACHE
const _AM_MAINTENANCE_CENTER_RETURN
const _AM_MAINTENANCE_CENTER_TIPS
const _AM_MAINTENANCE_CENTER_RESULT_SMARTY_COMPILE
const _AM_MAINTENANCE_CENTER_RESULT_XOOPS_CACHE