示例#1
0
 public function init()
 {
     $cacheLife = $this->cacheLife !== null ? $this->cacheLife : null;
     if ($cacheLife && CacheUtil::check()) {
         $this->cacheLife = $cacheLife;
         $this->allowCache = true;
     }
 }
示例#2
0
 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);
     }
 }