public function __construct($params = null)
 {
     if (!empty($params)) {
         $key = array_shift($params);
     }
     if (empty($key) && empty($_COOKIE[EpiSession::COOKIE])) {
         setcookie(EpiSession::COOKIE, md5(uniqid(rand(), true)), time() + 1209600, '/');
     }
     $this->memcached = EpiCache::getInstance(EpiCache::MEMCACHED);
     $this->key = empty($key) ? $_COOKIE[EpiSession::COOKIE] : $key;
     $this->store = $this->getAll();
 }
Beispiel #2
0
function getCache()
{
    $employ = EpiCache::employ();
    if ($employ && class_exists($employ)) {
        return EpiCache::getInstance($employ);
    } elseif (class_exists(EpiCache::APC)) {
        return EpiCache::getInstance(EpiCache::APC);
    } elseif (class_exists(EpiCache::MEMCACHED)) {
        return EpiCache::getInstance(EpiCache::MEMCACHED);
    } else {
        EpiException::raise(new EpiCacheTypeDoesNotExistException('Could not determine which cache handler to load', 404));
    }
}