/**
  * Construct cache backend
  * 
  * Session backend does not use any params
  *
  * @param array $params
  * @return CacheBackend
  */
 function __construct($params = null)
 {
     parent::__construct($params);
     if (!isset($_SESSION[$this->var_name])) {
         $_SESSION[$this->var_name] = array();
     }
     // if
 }
 /**
  * Constructor
  *
  * @param array $params
  * @return FileCacheBackend
  */
 function __construct($params = null)
 {
     parent::__construct($params);
     $cache_dir = array_var($params, 'cache_dir');
     if (empty($cache_dir)) {
         $cache_dir = ENVIRONMENT_PATH . '/cache/';
     }
     // if
     $this->setCacheDir($cache_dir);
     clearstatcache();
 }
Example #3
0
 public function __construct(array $config = null)
 {
     parent::__construct($config);
     $this->instance = new Memcached();
     if ($config['nodes'] && is_array($config['nodes'])) {
         foreach ($config['nodes'] as $node) {
             $this->instance->addServer($node['host'], $node['port']);
         }
     }
     if (!$this->instance instanceof Memcached) {
         throw new CacheException(1006, 'memcache');
     }
 }