本文整理汇总了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;
}
}