本文整理匯總了PHP中vB_Cache::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP vB_Cache::__construct方法的具體用法?PHP vB_Cache::__construct怎麽用?PHP vB_Cache::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vB_Cache
的用法示例。
在下文中一共展示了vB_Cache::__construct方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* 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'];
}
}
示例2: __construct
/**
* 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);
}
}
示例3: __construct
/**
* 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'];
}
}
示例4: __construct
/**
* 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;
}
示例5: __construct
/**
* 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;
}