public function processParam($cacheParam = null) { if ($cacheParam === null || $this->_cacheParam === $cacheParam) { return $this; } #初始化时间 $this->_startTime = microtime(true); $moduleName = get_class($this); if (!$cacheParam instanceof ZOL_DAL_ICacheKey) { static $keyMaker = null; if (!$keyMaker || !$keyMaker instanceof ZOL_DAL_ICacheKey) { #根据配置文件获取默认KEYMAKER $keyMakerName = ZOL_DAL_Config::getKeyMakerName($moduleName, 'NO'); $keyMaker = new $keyMakerName($moduleName, (array) $cacheParam); } else { $keyMaker->setParam((array) $cacheParam); } } else { $keyMaker =& $cacheParam; $keyMaker->setModuleName($moduleName); } #设置缓存存储类型 $keyMaker->setCacheSaveType($this->_cacheSaveType); $this->_cacheParam = $keyMaker->getCacheParam(); $this->_cacheKey = $keyMaker->getCacheKey(); return $this; }
private function getKeyNameObj($moduleName) { if (self::$_keyNamesObj === null) { $config = ZOL_DAL_Config::getConfig($moduleName); self::$_keyNamesObj = new $config['CACHE_KEYNAMES'](); } return self::$_keyNamesObj; }
/** * 初始化处理参数和模块名; */ public function processParam($cacheParam = '') { $moduleName = str_replace("Modules_", "", get_class($this)); #为了与旧框架缓存系统兼容 $this->_moduleName = $moduleName; if (!$cacheParam instanceof ZOL_DAL_ICacheKey) { $keyMakerName = ZOL_DAL_Config::getKeyMakerName($moduleName, 'MONGO'); $keyMaker = new $keyMakerName($this->_moduleName, (array) $cacheParam); } else { $keyMaker =& $cacheParam; $keyMaker->setModuleName($this->_moduleName); } $this->_cacheParam = $keyMaker->getCacheParam(); $this->_cacheKey = $keyMaker->getCacheKey(); return $this; }
/** * 初始化处理参数和模块名; */ public function processParam($cacheParam = null) { if ($cacheParam === null || $this->_cacheParam === $cacheParam) { return $this; } $moduleName = get_class($this); if (!$cacheParam instanceof ZOL_DAL_ICacheKey) { #根据配置文件获取默认KEYMAKER $keyMakerName = ZOL_DAL_Config::getKeyMakerName($moduleName, 'MEM'); $keyMaker = new $keyMakerName($moduleName, (array) $cacheParam); } else { $keyMaker =& $cacheParam; $keyMaker->setModuleName($moduleName); } $this->_cacheParam = $keyMaker->getCacheParam(); $this->_cacheKey = $keyMaker->getCacheKey(); return $this; }