本文整理汇总了PHP中CampCache::m_enabled方法的典型用法代码示例。如果您正苦于以下问题:PHP CampCache::m_enabled方法的具体用法?PHP CampCache::m_enabled怎么用?PHP CampCache::m_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CampCache
的用法示例。
在下文中一共展示了CampCache::m_enabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* CampCache class constructor.
*
*/
private function __construct($p_cacheEngine)
{
global $Campsite;
if (empty($p_cacheEngine)) {
return;
}
$this->m_cacheEngine = CacheEngine::Factory($p_cacheEngine);
if (is_null($this->m_cacheEngine) || !$this->m_cacheEngine->isSupported()) {
self::$m_enabled = false;
SystemPref::Set('DBCacheEngine', '');
CampSession::singleton()->setData('system_preferences', null, 'default', true);
return;
} else {
self::$m_enabled = true;
}
if (isset($Campsite['CAMP_SECRET'])) {
$this->m_secret = $Campsite['CAMP_SECRET'];
} else {
$this->m_secret = $Campsite['DATABASE_USER']
.$Campsite['DATABASE_NAME']
.$Campsite['DATABASE_SERVER_ADDRESS']
.$Campsite['WWW_DIR'];
}
} // fn __construct
示例2: __construct
/**
* CampCache class constructor.
* @deprecated from 4.3, removed in 4.4, use newscoop.cache service
*/
private function __construct($p_cacheEngine)
{
return;
global $Campsite;
if (empty($p_cacheEngine)) {
return;
}
$preferencesService = \Zend_Registry::get('container')->getService('system_preferences_service');
$this->m_cacheEngine = CacheEngine::Factory($p_cacheEngine);
if (is_null($this->m_cacheEngine) || !$this->m_cacheEngine->isSupported()) {
self::$m_enabled = false;
$preferencesService->DBCacheEngine = '';
return;
} else {
self::$m_enabled = true;
}
if (isset($Campsite['CAMP_SECRET'])) {
$this->m_secret = $Campsite['CAMP_SECRET'];
} else {
$this->m_secret = $Campsite['DATABASE_USER'] . $Campsite['DATABASE_NAME'] . $Campsite['DATABASE_SERVER_ADDRESS'] . $Campsite['WWW_DIR'];
}
}