コード例 #1
0
ファイル: apc.php プロジェクト: siddht1/abantecart-src
 /**
  * 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);
 }
コード例 #2
0
ファイル: file.php プロジェクト: siddht1/abantecart-src
 /**
  * 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;
 }
コード例 #3
0
ファイル: memcache.php プロジェクト: siddht1/abantecart-src
 /**
  * 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);
     }
 }
コード例 #4
0
ファイル: memcached.php プロジェクト: siddht1/abantecart-src
 /**
  * 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);
     }
 }