set('cachestatus', 1) ->save(false); } if(!is_writable(e_CACHE_CONTENT)) { e107::getRender()->tablerender(CACLAN_3, CACLAN_10."
(".$CACHE_DIRECTORY.")"); require_once("footer.php"); exit; } if (isset($_POST['submit_cache'])) { e107::getConfig()->set('cachestatus', intval($_POST['cachestatus'])) ->set('syscachestatus', intval($_POST['syscachestatus'])) ->save(false); } if (isset($_POST['trigger_empty_cache'])) { e107::getAdminLog()->logSuccess(CACLAN_6); switch ($_POST['option_clear_cache']) { case 'empty_contentcache': $ec->clear(); e107::getAdminLog()->flushMessages(CACLAN_5); break; case 'empty_syscache': $ec->clear_sys(); e107::getAdminLog()->flushMessages(CACLAN_16); break; case 'empty_dbcache': admin_page_cache_erase(e_CACHE_DB, '*.php'); e107::getAdminLog()->flushMessages(CACLAN_24); break; case 'empty_imgcache': admin_page_cache_erase(e_CACHE_IMAGE, '*.cache\.bin'); e107::getAdminLog()->flushMessages(CACLAN_25); break; // used in standard page output and internal JS includes case 'empty_browsercache': e107::getConfig()->set('e_jslib_browser_cache', time())->save(false); e107::getAdminLog()->flushMessages(CACLAN_25); break; // all default: $ec->clear(); $ec->clear_sys(); admin_page_cache_erase(e_CACHE_DB, '*.php'); admin_page_cache_erase(e_CACHE_IMAGE, '*.cache\.bin'); e107::getConfig()->set('e_jslib_browser_cache', time())->save(false); e107::getAdminLog()->flushMessages(CACLAN_26); break; } } $syscache_files = glob(e_CACHE_CONTENT.'S_*.*'); $cache_files = glob(e_CACHE_CONTENT.'C_*.*'); $imgcache_files = glob(e_CACHE_IMAGE.'*.cache.bin'); $dbcache_files = glob(e_CACHE_DB.'*.php'); $syscache_files_num = count($syscache_files); $cache_files_num = count($cache_files); $imgcache_files_num = count($imgcache_files); $dbcache_files_num = count($dbcache_files); $syscache_label = CACLAN_17.' '.$syscache_files_num.' '.($syscache_files_num != 1 ? CACLAN_19 : CACLAN_18).''; $contentcache_label = CACLAN_17.' '.$cache_files_num.' '.($cache_files_num != 1 ? CACLAN_19 : CACLAN_18).''; $imgcache_label = CACLAN_17.' '.$imgcache_files_num.' '.($imgcache_files_num != 1 ? CACLAN_19 : CACLAN_18).''; $dbcache_label = CACLAN_17.' '.$dbcache_files_num.' '.($dbcache_files_num != 1 ? CACLAN_19 : CACLAN_18).''; $text = "
".CACLAN_3."
".CACLAN_1."
".CACLAN_11.": {$contentcache_label}
".CACLAN_13."
".$frm->radio_switch('cachestatus', e107::getPref('cachestatus'))."
".CACLAN_12.": {$syscache_label}
".CACLAN_14."
".$frm->radio_switch('syscachestatus', e107::getPref('syscachestatus'))."
".CACLAN_20.": {$dbcache_label}
".CACLAN_21."
".LAN_ENABLED."
".CACLAN_22.": {$imgcache_label}
".CACLAN_23."
".LAN_ENABLED."
".$frm->admin_button('submit_cache', CACLAN_2, 'update f-right')." ".$frm->selectbox('option_clear_cache', array( 'empty_all' => CACLAN_26, 'empty_contentcache' => CACLAN_5, 'empty_syscache' => CACLAN_16, 'empty_dbcache' => CACLAN_24, 'empty_imgcache' => CACLAN_25, 'empty_browsercache' => CACLAN_27, ))." ".$frm->admin_button('trigger_empty_cache', LAN_DELETE, 'delete')."
"; e107::getRender()->tablerender(CACLAN_3, $emessage->render().$text); require_once("footer.php"); /** * @param string $path * @param string $mask * @return void */ function admin_page_cache_erase($path, $mask) { $fl = e107::getFile(false); $fl->mode = 'fname'; $files = $fl->get_files($path, $fmask); if($files) { foreach ($files as $file) { unlink($path.$file); } } } ?>