memcached website: http://www.danga.com/memcached/
Author: Jan Schneider (jan@horde.org)
Author: Michael Slusarz (slusarz@horde.org)
Author: Didi Rieder (adrieder@sbox.tugraz.at)
Inheritance: implements Serializable
コード例 #1
0
ファイル: MemcacheTest.php プロジェクト: jubinpatel/horde
 public static function setUpBeforeClass()
 {
     if (!extension_loaded('memcache')) {
         self::$reason = 'No memcache extension.';
         return;
     }
     $config = self::getConfig('SESSIONHANDLER_MEMCACHE_TEST_CONFIG', dirname(__FILE__) . '/..');
     if (!$config || empty($config['sessionhandler']['memcache'])) {
         self::$reason = 'No memcache configuration.';
         return;
     }
     $memcache = new Horde_Memcache($config['sessionhandler']['memcache']);
     $memcache->delete('sessionid');
     $memcache->delete('sessionid2');
     self::$handler = new Horde_SessionHandler_Storage_Memcache(array('memcache' => $memcache, 'track' => true));
     parent::setUpBeforeClass();
 }
コード例 #2
0
ファイル: Memcache.php プロジェクト: horde/horde
 /**
  * Do garbage collection for session tracking information.
  */
 public function trackGC()
 {
     $this->_memcache->lock($this->_trackID);
     $ids = $this->_memcache->get($this->_trackID);
     if (empty($ids)) {
         $this->_memcache->unlock($this->_trackID);
         return;
     }
     $tstamp = time() - $this->_params['track_lifetime'];
     $alter = false;
     foreach ($ids as $key => $val) {
         if ($tstamp > $val) {
             unset($ids[$key]);
             $alter = true;
         }
     }
     if ($alter) {
         $this->_memcache->set($this->_trackID, $ids);
     }
     $this->_memcache->unlock($this->_trackID);
 }
コード例 #3
0
ファイル: Memcache.php プロジェクト: raz0rsdge/horde
 /**
  */
 public function clear()
 {
     $this->_memcache->flush();
 }
コード例 #4
0
ファイル: Memcache.php プロジェクト: horde/horde
 /**
  * Get the statistics output from the current memcache pool.
  *
  * @see Horde_Memcache#stats()
  */
 public function stats()
 {
     return $this->_memcache->stats();
 }
コード例 #5
0
ファイル: Memcache.php プロジェクト: horde/horde
 /**
  */
 public function clear()
 {
     $this->_memcache->flush();
     $this->_objectcache = array();
 }