示例#1
0
 public function __construct()
 {
     if (self::$obMemcache == null) {
         self::$obMemcache = new \Memcache();
         $cacheConfig = Config\Configuration::getValue("cache");
         $v = isset($cacheConfig["memcache"]) ? $cacheConfig["memcache"] : null;
         if ($v != null && isset($v["host"]) && $v["host"] != "") {
             if ($v != null && isset($v["port"])) {
                 $port = intval($v["port"]);
             } else {
                 $port = 11211;
             }
             if (self::$obMemcache->connect($v["host"], $port)) {
                 self::$isConnected = true;
                 register_shutdown_function(array("\\Bitrix\\Main\\Data\\CacheEngineMemcache", "close"));
             }
         }
     }
     $v = Config\Configuration::getValue("cache");
     if ($v != null && isset($v["sid"]) && $v["sid"] != "") {
         $this->sid = $v["sid"];
     } else {
         $this->sid = "BX";
     }
 }
 public function __construct()
 {
     if (self::$obMemcache == null) {
         self::$obMemcache = new \Memcache();
         $cacheConfig = Config\Configuration::getValue("cache");
         $v = isset($cacheConfig["memcache"]) ? $cacheConfig["memcache"] : null;
         if ($v != null && isset($v["host"]) && $v["host"] != "") {
             if ($v != null && isset($v["port"])) {
                 $port = intval($v["port"]);
             } else {
                 $port = 11211;
             }
             if (self::$obMemcache->pconnect($v["host"], $port)) {
                 self::$isConnected = true;
             }
         }
     }
     $v = Config\Configuration::getValue("cache");
     if ($v != null && isset($v["sid"]) && $v["sid"] != "") {
         $this->sid = $v["sid"];
     } else {
         $this->sid = "BX";
     }
 }