コード例 #1
0
 /**
  * Constructor protected to enforce singleton use.
  * @see instance()
  */
 protected function __construct($cachetype)
 {
     parent::__construct($cachetype);
     $this->memcached = vB_Memcache::instance();
     $check = $this->memcached->connect();
     if ($check === 3) {
         trigger_error('Unable to connect to memcache server', E_USER_ERROR);
     }
     $this->expiration = 48 * 60 * 60;
     // two days
     $this->timeNow = vB::getRequest()->getTimeNow();
     //get the memcache prefix.
     $config = vB::getConfig();
     if (empty($config['Cache']['memcacheprefix'])) {
         $this->prefix = $config['Database']['tableprefix'];
     } else {
         $this->prefix = $config['Cache']['memcacheprefix'];
     }
 }