Пример #1
0
 public static function init()
 {
     if (self::$inicializado) {
         return;
     }
     if (class_exists('Memcache') && !self::$memcache) {
         self::$memcache = new Memcache();
         self::$memcache->addserver(MEMCACHE_HOST, MEMCACHE_PORTA);
         $stats = @self::$memcache->getExtendedStats();
         $available = (bool) $stats[MEMCACHE_HOST . ":" . MEMCACHE_PORTA];
         if ($available) {
             self::$inicializado = true;
         } else {
             self::$memcache = false;
         }
     }
 }