Exemplo n.º 1
0
    $sql = "\r\n    UPDATE\r\n      se_settings\r\n    SET\r\n      setting_cache_enabled='{$setting_cache_enabled}',\r\n      setting_cache_default='{$setting_cache_default}',\r\n      setting_cache_lifetime='{$setting_cache_lifetime}',\r\n      setting_cache_file_options='{$setting_cache_file_options}',\r\n      setting_cache_memcache_options='{$setting_cache_memcache_options}'\r\n  ";
    $database->database_query($sql) or die($database->database_error());
}
// Unserialize options for template/config generation
if ($setting['setting_cache_file_options'] && is_string($setting['setting_cache_file_options'])) {
    $cache_file_options = @unserialize($setting['setting_cache_file_options']);
}
if ($setting['setting_cache_memcache_options'] && is_string($setting['setting_cache_memcache_options'])) {
    $cache_memcache_options = @unserialize($setting['setting_cache_memcache_options']);
}
// GET AVAILABLE STORAGE OPTIONS IF NOT SAVING
if ($task != "dosave") {
    //var_dump($cache_file_options);
    $filecache_test_root = preg_replace('/^[.]/', SE_ROOT, $cache_file_options['root']);
    $memcache_test_servers = $cache_memcache_options['servers'];
    $available_storage = SECache::getStorageHandlers();
    if (!is_array($available_storage)) {
        $available_storage = array();
    }
}
/*
// Check if enabled and display error message
if( (!$setting['setting_cache_enabled'] || !in_array("file", $available_storage)) && $cache_options['storage']=="file" )
{
  $is_error = "Make sure the cache directory specified exists and is chmod 777";
}
elseif( (!$setting['setting_cache_enabled'] || !in_array("file", $available_storage)) && $cache_options['storage']=="memcache" )
{
  $is_error = "Make sure the memcache extension is installed and a memcache server is running.";
}
*/