Файл: adultscript-2.0.3-pro/files/libraries/framework/cache.php
Строк: 21
<?php
defined('_VALID') or die('Restricted Access!');
class VCache
{
protected $driver;
protected $secret;
protected $lifetime;
protected $ttls;
public function __construct()
{
$cfg = VF::cfg('core.config');
$this->driver = ($cfg['cache'] == '1') ? $cfg['cache_driver'] : 'none';
$this->secret = $cfg['secret'];
$this->lifetime = intval($cfg['cache_lifetime'])*60;
if ($this->driver == 'memcache') {
$this->memcache_servers = $cfg['memcache_servers'];
$this->memcache_persistent = $cfg['memcache_persistent'];
$this->memcache_compression = $cfg['memcache_compression'];
}
unset($cfg);
}
public function getDriver()
{
VF::load('framework.cache.'.$this->driver);
$cache_class = 'VCache_Driver_'.$this->driver;
return $cache = new $cache_class();
}
public function get_key($cache_id)
{
return 'ASPRO_'.md5($cache_id.$this->secret);
}
}
?>