Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * @param int $expiration
  * @param int $lock_time
  *
  * @since   1.2.7
  */
 public function __construct($expiration, $lock_time = 0)
 {
     if (!$lock_time) {
         $lock_time = 10;
     }
     parent::__construct($expiration, $lock_time);
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param int $expiration
  * @param int $lock_time
  *
  * @since   1.2.7
  */
 public function __construct($expiration, $lock_time = 0)
 {
     if (!$lock_time) {
         $lock_time = 10;
     }
     parent::__construct($expiration, $lock_time);
     $this->path = DIR_CACHE;
 }
Ejemplo n.º 3
0
 /**
  * Constructor
  *
  * @param int $expiration
  * @param int $lock_time
  * @throws AException
  * @since   1.2.7
  */
 public function __construct($expiration, $lock_time = 0)
 {
     if (!$lock_time) {
         $lock_time = 10;
     }
     parent::__construct($expiration, $lock_time);
     $this->connect = new Memcache();
     $this->connect->addServer($this->hostname, $this->port, $this->persistent);
     $test = @$this->connect->connect($this->hostname, $this->port);
     if ($test == false) {
         throw new AException(AC_ERR_LOAD, 'Error: Could not connect to memcache server.');
     }
     // Memcached has no list keys, we do our own accounting, initialise key index
     if ($this->connect->get($this->secret . '-index') === false) {
         $empty = array();
         $this->connect->set($this->secret . '-index', $empty, $this->compress_level, 0);
     }
 }
Ejemplo n.º 4
0
 /**
  * Constructor
  *
  * @param int $expiration
  * @param int $lock_time
  * @throws AException
  * @since   1.2.7
  */
 public function __construct($expiration, $lock_time = 0)
 {
     if (!$lock_time) {
         $lock_time = 10;
     }
     parent::__construct($expiration, $lock_time);
     // Create the memcache connection
     if ($this->persistent) {
         $this->connect = new Memcached(session_id());
     } else {
         $this->connect = new Memcached();
     }
     $test = $this->connect->addServer($this->hostname, $this->port);
     if ($test == false) {
         throw new AException(AC_ERR_LOAD, 'Error: Could not connect to memcached server.');
     }
     $this->connect->setOption(Memcached::OPT_COMPRESSION, $this->compress_level);
     // Memcached has no list keys, we do our own accounting, initialise key index
     if ($this->connect->get($this->secret . '-index') === false) {
         $empty = array();
         $this->connect->set($this->secret . '-index', $empty, 0);
     }
 }