本文整理汇总了PHP中CacheManager::CachingAvailable方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::CachingAvailable方法的具体用法?PHP CacheManager::CachingAvailable怎么用?PHP CacheManager::CachingAvailable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheManager
的用法示例。
在下文中一共展示了CacheManager::CachingAvailable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initDataProvider
function initDataProvider($connection = false)
{
global $CONFIG, $DB_CONNECTOR, $CM;
if (!empty($CONFIG["gl_datprov"])) {
if (!defined("DB_PREFIX")) {
define("DB_PREFIX", $CONFIG["gl_db_prefix"]);
}
$DB_CONNECTOR = new DBManager($CONFIG["gl_db_user"], $CONFIG["gl_db_pass"], $CONFIG["gl_db_host"], $CONFIG["gl_db_name"], $CONFIG["gl_db_prefix"]);
if (!empty($CONFIG["gl_db_ext"])) {
DBManager::$Extension = $CONFIG["gl_db_ext"];
}
if ($DB_CONNECTOR->InitConnection()) {
$connection = true;
}
}
if (!defined("DB_CONNECTION")) {
define("DB_CONNECTION", $connection);
}
if ($connection) {
loadDatabaseConfig(false, $CONFIG["gl_db_prefix"]);
if (!isset($CONFIG["gl_caen"])) {
$CONFIG["gl_caen"] = 1;
}
if (!isServerSetup() && !is("IN_API") && CacheManager::CachingAvailable($CONFIG["gl_caen"]) !== false) {
$gttl = min($CONFIG["poll_frequency_clients"], $CONFIG["poll_frequency_tracking"]) * 2;
$sttl = !empty($CONFIG["gl_st_upin"]) ? $CONFIG["gl_st_upin"] : 3600;
$CM = new CacheManager(md5(SUBSITEHOST . $CONFIG["gl_lzid"] . $CONFIG["gl_db_prefix"] . $CONFIG["gl_db_pass"] . $CONFIG["gl_db_user"] . $CONFIG["gl_db_name"]), $gttl, array(111 => array("VISITOR", 512), 112 => array("EVENTS", 128), 113 => array("INTERNAL", 256, $gttl * 2), 114 => array("GROUPS", 256, $gttl * 2), 115 => array("FILTERS", 128, $gttl * 2), 116 => array("DBCNF", 128, $gttl * 2), 117 => array("STATS", 1, $sttl), 118 => array("DUT", 1)));
$CM->Read();
}
loadDatabaseConfig(true, $CONFIG["gl_db_prefix"]);
}
return $connection;
}
示例2: InitCacheManager
static function InitCacheManager()
{
if (CacheManager::CachingAvailable(Server::$Configuration->File["gl_caen"]) !== false) {
$gttl = min(Server::$Configuration->File["poll_frequency_clients"], Server::$Configuration->File["poll_frequency_tracking"]) * 2;
$tttl = abs(min(Server::$Configuration->File["timeout_clients"], Server::$Configuration->File["timeout_chats"]) - 5);
$sttl = !empty(Server::$Configuration->File["gl_st_upin"]) ? Server::$Configuration->File["gl_st_upin"] : 3600;
$static_ttl = 3600;
CacheManager::$ActiveManager = new CacheManager(md5(SUBSITEHOST . Server::$Configuration->File["gl_lzid"] . Server::$Configuration->File["gl_db_prefix"] . Server::$Configuration->File["gl_db_pass"] . Server::$Configuration->File["gl_db_user"] . Server::$Configuration->File["gl_db_name"]), $gttl, array(DATA_CACHE_KEY_VISITORS => array("VISITOR", 512), DATA_CACHE_KEY_EVENTS => array("EVENTS", 128, $static_ttl), DATA_CACHE_KEY_OPERATORS => array("INTERNAL", 256, $tttl, true), DATA_CACHE_KEY_GROUPS => array("GROUPS", 256, $tttl, true), DATA_CACHE_KEY_FILTERS => array("FILTERS", 128, $static_ttl, true), DATA_CACHE_KEY_DBCONFIG => array("DBCNF", 128, $static_ttl), DATA_CACHE_KEY_STATS => array("STATS", 1, $sttl, true), DATA_CACHE_KEY_DATA_TIMES => array("DUT", 1, $static_ttl)));
CacheManager::$ActiveManager->Read();
}
}