示例#1
0
 /**
  * 获得Memcache的连接对象
  */
 public static function getLink($paramArr)
 {
     $options = array('serverName' => 'Default');
     if (is_array($paramArr)) {
         $options = array_merge($options, $paramArr);
     }
     extract($options);
     if (!$serverName) {
         return false;
     }
     return API_Memcached::getLink($serverName);
     #获得redis对象
 }
示例#2
0
 public static function connect($ip = "", $port = "")
 {
     #链接memcached服务器
     self::init();
     if ("" == $ip) {
         $ip = self::$IP;
     }
     if ("" == $port) {
         $port = self::$PORT;
     }
     if (self::$mem->connect($ip, $port)) {
         self::$CONNECT_OL = true;
         return 1;
     } else {
         return 0;
     }
 }