/** * Constructor protected to enforce singleton use. * @see instance() */ protected function __construct($cachetype) { parent::__construct($cachetype); //get the APC prefix. $config = vB::getConfig(); if (empty($config['Cache']['apcprefix'])) { $this->prefix = $config['Database']['tableprefix']; } else { $this->prefix = $config['Cache']['apcprefix']; } }
/** * Constructor public to allow for separate automated unit testing. Actual code should use * vB_Cache::instance(); * @see vB_Cache::instance() */ public function __construct($cachetype) { parent::__construct($cachetype); $this->requestStart = vB::getRequest()->getTimeNow(); $config = vB::getConfig(); $this->cachetype = $cachetype; if (!isset($config['Cache']['fileCachePath'])) { throw new vB_Exception_Cache('need_filecache_location'); } $this->cacheLocation = $config['Cache']['fileCachePath']; if (!is_dir($this->cacheLocation) or !is_writable($this->cacheLocation)) { throw new vB_Exception_Cache('invalid_filecache_location- ' . $this->cacheLocation); } }
/** * 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']; } }
/** * Constructor public to allow for separate automated unit testing. Actual code should use * vB_Cache::instance(); * @see vB_Cache::instance() */ public function __construct($cachetype) { parent::__construct($cachetype); $this->cachetype = $cachetype; }
/** * Constructor public to allow for separate automated unit testing. Actual code should use * vB_Cache::instance(); * @see vB_Cache::instance() */ public function __construct($cachetype) { parent::__construct($cachetype); $this->assertor = vB::getDbAssertor(); $this->requestStart = $this->timeNow; }