Пример #1
0
 static function init()
 {
     if (null === self::$memcache) {
         self::$memcache = new Memcache();
         self::$memcache->connect(self::HOST, self::PORT);
     }
     return self::$memcache;
 }
Пример #2
0
 private static function init()
 {
     self::$error_code = self::INIT_SUCCESS;
     if (empty(self::$mc)) {
         self::$mc = new CloudMemcache();
         if (self::$mc == false) {
             self::$error_code = self::ERROR_INIT;
             return false;
         }
     }
 }
Пример #3
0
 public function __construct()
 {
     if (NULL === self::$memcache) {
         self::$memcache = new Memcache();
         self::$memcache->connect(self::HOST, self::PORT);
     }
 }