/**
  * @see parent::__construct()
  */
 function __construct($key, $label = null)
 {
     parent::__construct($key, $label);
     $this->path = CAppUI::conf("root_dir") . "/tmp/locks";
     $this->process = getmypid();
     $this->filename = "{$this->path}/" . $this->getLockKey();
     CMbPath::forceDir(dirname($this->filename));
 }
 /**
  * @see parent::__construct()
  */
 function __construct($key, $label = null)
 {
     if (!function_exists("apc_exists")) {
         throw new Exception("APC unavailable");
     }
     if (ini_get("apc.slam_defense")) {
         throw new Exception("APC available, but slam defense should be disabled");
     }
     parent::__construct($key, $label);
 }
示例#3
0
 /**
  * @see parent::__construct()
  */
 function __construct($key, $label = null)
 {
     parent::__construct($key, $label);
     $client = null;
     $list = $this->getServerAddresses();
     foreach ($list as $_server) {
         try {
             $client = new CRedisClient($_server[0], $_server[1]);
             $client->connect();
             break;
         } catch (Exception $e) {
             $client = null;
         }
     }
     if (!$client) {
         throw new Exception("No Redis server reachable");
     }
     $this->client = $client;
 }
 /**
  * @see parent::release()
  */
 function release()
 {
     unset(self::$open_mutexes[$this->key]);
     $this->driver->release();
 }