protected function connect($config = array()) { if (empty($config)) { $config = $this->_configName; } $_config = array(); /** @var \Yaf\Config\Ini $sysConfig */ $sysConfig = Registry::get('config'); if ($sysConfig && ($tmp = $sysConfig->get($config))) { $_config = $tmp->toArray(); } elseif (is_array($config)) { $_config = $config; } $_config['adapter'] = 'Redis'; $_config['params'][\Redis::OPT_PREFIX] = $this->_keyPrefix ?: get_class($this); $_config['params'][\Redis::OPT_SERIALIZER] = \Redis::SERIALIZER_PHP; return Cache::instance('__redis_model__', $_config); }
public function init() { \eYaf\Cache::instance('_yac'); //缓存 }