public function __construct($prefix = '')
{
if ($prefix == false) {
$prefix = md5(app()->environment() . site_url());
}
$adapter_from_config = \Config::get('microweber.cache_adapter');
$use_file_cache = true;
if (!$adapter_from_config || $adapter_from_config == 'file' || $adapter_from_config == 'auto') {
$use_file_cache = true;
} elseif ($adapter_from_config == 'apc') {
if (function_exists('apc_fetch') || function_exists('apcu_fetch')) {
$use_file_cache = false;
$this->adapter = new ApcStorage($prefix);
}
} elseif ($adapter_from_config == 'memcached') {
if (class_exists('Memcached', false)) {
$use_file_cache = false;
$this->adapter = new MemcachedStorage($prefix);
}
} elseif ($adapter_from_config == 'xcache') {
if (function_exists('xcache_get')) {
$use_file_cache = false;
$this->adapter = new XCacheStorage($prefix);
}
}
if ($use_file_cache) {
$this->adapter = new FileStorage($prefix);
}
}