Exemple #1
0
 function setType($type = '', $aConfig = array())
 {
     //$type=file/mmc  //配置缓存类型
     $_ALYSconfig = \YcheukfReport\Lib\ALYS\ALYSConfig::get();
     $this->cacheType = empty($type) ? $_ALYSconfig['cache']['type'] : $type;
     $this->cacheHandelKey = $_ALYSconfig['cache']['file_mem_path'];
     $aConfig = empty($aConfig) ? $_ALYSconfig['cache'] : $aConfig;
     switch ($this->cacheType) {
         case 'mmc':
             $this->cac = new \Memcache();
             $this->cac->connect($aConfig['mmc']['host'], $aConfig['mmc']['port']);
             break;
         case 'file':
             $this->cac = new \Cache_Lite($aConfig[$this->cacheHandelKey]);
             break;
         case 'zf2cache':
         default:
             $this->cac = \YcheukfCommon\Lib\Functions::getCacheObject($_ALYSconfig['smHandle'], 'filesystem');
             break;
     }
 }