public function init() { $cacheLife = $this->cacheLife !== null ? $this->cacheLife : null; if ($cacheLife && CacheUtil::check()) { $this->cacheLife = $cacheLife; $this->allowCache = true; } }
private function cmd($cmd, $name, $ttl = 0) { static $allowcache; if ($allowcache === null) { $cc = CacheUtil::check(); $allowcache = $cc == "mem" || $cc == "redis"; } if ($allowcache) { return $this->processCmdCache($cmd, $name, $ttl); } else { return $this->processCmdDb($cmd, $name, $ttl); } }