示例#1
0
 private static function _CreateCacheInstance($cluster = 'default')
 {
     $cache_instance = new MemCache();
     foreach ($GLOBALS['CONFIG_MEMCACHE'][$cluster] as $one) {
         list($ip, $port, $weight) = explode(':', $one);
         $a = $cache_instance->addServer($ip, $port, true, $weight, 1, 15, true, array('Memcache', 'FailureCallback'));
     }
     $cache_instance->setCompressThreshold(5000);
     // > 5k then zlib
     return $cache_instance;
 }