本文整理匯總了PHP中W3_Config::get_cache_option方法的典型用法代碼示例。如果您正苦於以下問題:PHP W3_Config::get_cache_option方法的具體用法?PHP W3_Config::get_cache_option怎麽用?PHP W3_Config::get_cache_option使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類W3_Config
的用法示例。
在下文中一共展示了W3_Config::get_cache_option方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: is_cache_configured
public function is_cache_configured()
{
$cache_configured = true;
if ($this->is_wp_super_cache_detected()) {
return $this->is_wp_super_cache_active() && $this->does_wp_super_cache_have_configured_uas() || !$this->is_wp_super_cache_active();
}
// Check W3
if ($this->is_w3_plugin_detected()) {
$w3_config = new W3_Config(true);
if ($w3_config) {
// Check to see if the Page Cache is enabled
if ($w3_config->get_cache_option('pgcache.enabled')) {
// If it's enabled, we need to make sure the user agents have been updated
$rejected_user_agents = $w3_config->get_cache_option('pgcache.reject.ua');
if (!$this->find_in_array_no_case('iphone', $rejected_user_agents)) {
$cache_configured = false;
}
if (!$cache_configured && ($user_groups = $w3_config->get_array('mobile.rgroups')) && is_array($user_groups) && count($user_groups) > 0) {
foreach ($user_groups as $group) {
if ($group['enabled'] && $this->find_in_array_no_case('iphone', $group['agents']) && $group['theme'] == '' && $group['redirect'] == '') {
$cache_configured = true;
add_filter('wptouch_show_mobile_switch_link', '__return_false');
}
}
}
}
}
return $cache_configured;
}
if ($this->is_wordfence_detected()) {
$cache_type = wfConfig::get('cacheType', false);
if (!$cache_type) {
$cache_configured = true;
} else {
$cookie_set = false;
$user_agents_set = false;
$exclusions = wfConfig::get('cacheExclusions', false);
if ($exclusions) {
$exclusions = unserialize($exclusions);
if ($exclusions) {
foreach ($exclusions as $exclusion) {
if ($exclusion['pt'] == 'cc' && ($exclusion['p'] = 'wptouch_switch_toggle')) {
$cookie_set = true;
} else {
if ($exclusion['pt'] == 'uac' && strtolower($exclusion['p']) == 'iphone') {
$user_agents_set = true;
}
}
if ($cookie_set && $user_agents_set) {
break;
}
}
}
}
$cache_configured = $cookie_set && $user_agents_set;
}
return $cache_configured;
}
return $cache_configured;
}
示例2:
/**
* Bad Behavior support
* @return void
*/
function _bad_behavior()
{
$bb_file = $this->_config->get_cache_option('pgcache.bad_behavior_path');
if ($bb_file != '') {
require_once $bb_file;
}
}