$cache_memcache_options['server_hosts'][$i], 'port' => $cache_memcache_options['server_ports'][$i] ); } unset($cache_memcache_options['server_hosts']); unset($cache_memcache_options['server_ports']); } // Check available storage $available_storage = array(); if( is_dir($cache_file_options['root']) && is_writeable($cache_file_options['root']) ) $available_storage[] = 'file'; if( function_exists('memcache_connect') && @memcache_connect(@$cache_memcache_options['servers'][0]['host'], @$cache_memcache_options['servers'][0]['port']) ) $available_storage[] = 'memcache'; if( function_exists('apc_add') ) $available_storage[] = 'apc'; if( function_exists('xcache_get') ) { include_once SE_ROOT.DS.'include'../admin/.DS.'cake'.DS.'libs'.DS.'cache'.DS.'xcache.php'; $test_xcache = new XcacheEngine(); $test_xcache->init($cache_xcache_options); if( $test_xcache->__auth() ) $available_storage[] = 'xcache'; } //if( !in_array($cache_default, $available_storage) ) // $cache_default = ''; // SET ENABLED $cache_file_options['enabled'] = ( in_array('file', $available_storage ) ); $cache_memcache_options['enabled'] = ( in_array('memcache', $available_storage ) ); $cache_xcache_options['enabled'] = ( in_array('xcache', $available_storage ) ); if( $task == 'dosave' ) { // Serialize $setting_cache_file_options = addslashes(serialize($cache_file_options)); $setting_cache_memcache_options = addslashes(serialize($cache_memcache_options)); $setting_cache_xcache_options = addslashes(serialize($cache_xcache_options)); // Assign $setting['setting_cache_enabled'] = $cache_enabled; $setting['setting_cache_default'] = $cache_default; $setting['setting_cache_lifetime'] = $cache_lifetime; $setting['setting_cache_file_options'] = $setting_cache_file_options; $setting['setting_cache_memcache_options'] = $setting_cache_memcache_options; $setting['setting_cache_xcache_options'] = $setting_cache_xcache_options; $smarty->assign_by_ref('setting', $setting); $sql = " UPDATE se_settings SET setting_cache_enabled='{$cache_enabled}', setting_cache_default='{$cache_default}', setting_cache_lifetime='{$cache_lifetime}', setting_cache_file_options='{$setting_cache_file_options}', setting_cache_memcache_options='{$setting_cache_memcache_options}', setting_cache_xcache_options='{$setting_cache_xcache_options}' "; $database->database_query($sql) or die($database->database_error()); } // ASSIGN VARIABLES AND SHOW PAGE $smarty->assign('result', $result); $smarty->assign('is_error', $is_error); $smarty->assign('task', $task); $smarty->assign('available_storage', $available_storage); $smarty->assign('cache_file_options', $cache_file_options); $smarty->assign('cache_memcache_options', $cache_memcache_options); $smarty->assign('cache_xcache_options', $cache_xcache_options); include "admin_footer.php"; ?>