本文整理汇总了PHP中Util_Environment::is_w3tc_pro方法的典型用法代码示例。如果您正苦于以下问题:PHP Util_Environment::is_w3tc_pro方法的具体用法?PHP Util_Environment::is_w3tc_pro怎么用?PHP Util_Environment::is_w3tc_pro使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util_Environment
的用法示例。
在下文中一共展示了Util_Environment::is_w3tc_pro方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: w3tc_config_save
public function w3tc_config_save($config)
{
// frontend activity
$engine = $config->get_string(array('fragmentcache', 'engine'));
$is_frontend_active = !empty($engine) && Util_Environment::is_w3tc_pro($config);
$config->set_extension_active_frontend('fragmentcache', $is_frontend_active);
}
示例2: run
function run()
{
add_filter('w3tc_config_default_values', array($this, 'w3tc_config_default_values'));
add_action('w3tc_register_fragment_groups', array($this, 'register_groups'));
$this->_config = Dispatcher::config();
if (Util_Environment::is_w3tc_pro($this->_config)) {
if (!is_admin()) {
/**
* Register the caching of content to specific hooks
*/
foreach (array('genesis_header', 'genesis_footer', 'genesis_sidebar', 'genesis_loop', 'wp_head', 'wp_footer', 'genesis_comments', 'genesis_pings') as $hook) {
add_action($hook, array($this, 'cache_genesis_start'), -999999999);
add_action($hook, array($this, 'cache_genesis_end'), 999999999);
}
foreach (array('genesis_do_subnav', 'genesis_do_nav') as $filter) {
add_filter($filter, array($this, 'cache_genesis_filter_start'), -999999999);
add_filter($filter, array($this, 'cache_genesis_filter_end'), 999999999);
}
}
/**
* Since posts pages etc are cached individually need to be able to flush just those and not all fragment
*/
add_action('clean_post_cache', array($this, 'flush_post_fragment'));
add_action('clean_post_cache', array($this, 'flush_terms_fragment'), 0, 0);
$this->_request_uri = $_SERVER['REQUEST_URI'];
}
}
示例3: run
/**
* Runs plugin
*/
function run()
{
add_filter('cron_schedules', array($this, 'cron_schedules'), 5);
add_action('init', array($this, 'init'), 1);
if (Util_Environment::is_w3tc_pro_dev() && Util_Environment::is_w3tc_pro($this->_config)) {
add_action('wp_footer', array($this, 'pro_dev_mode'));
}
add_action('admin_bar_menu', array($this, 'admin_bar_menu'), 150);
if (isset($_REQUEST['w3tc_theme']) && isset($_SERVER['HTTP_USER_AGENT']) && stristr($_SERVER['HTTP_USER_AGENT'], W3TC_POWERED_BY) !== false) {
add_filter('template', array($this, 'template_preview'));
add_filter('stylesheet', array($this, 'stylesheet_preview'));
} elseif ($this->_config->get_boolean('mobile.enabled') || $this->_config->get_boolean('referrer.enabled')) {
add_filter('template', array($this, 'template'));
add_filter('stylesheet', array($this, 'stylesheet'));
}
/**
* Create cookies to flag if a pgcache role was loggedin
*/
if (!$this->_config->get_boolean('pgcache.reject.logged') && $this->_config->get_array('pgcache.reject.logged_roles')) {
add_action('set_logged_in_cookie', array($this, 'check_login_action'), 0, 5);
add_action('clear_auth_cookie', array($this, 'check_login_action'), 0, 5);
}
if ($this->_config->get_string('common.support') == 'footer') {
add_action('wp_footer', array($this, 'footer'));
}
if ($this->can_ob()) {
ob_start(array($this, 'ob_callback'));
}
}
示例4: run
/**
* Runs plugin
*/
function run()
{
add_action('admin_init', array($this, 'admin_init'));
add_action('wp_ajax_w3tc_verify_plugin_license_key', array($this, 'action_verify_plugin_license_key'));
add_action("w3tc_config_ui_save-w3tc_general", array($this, 'possible_state_change'), 2, 10);
add_action('w3tc_message_action_licensing_upgrade', array($this, 'w3tc_message_action_licensing_upgrade'));
if (!Util_Environment::is_w3tc_pro($this->_config)) {
add_filter('w3tc_admin_bar_menu', array($this, 'w3tc_admin_bar_menu'));
}
}
示例5: widget_form
function widget_form()
{
$storage = new UsageStatistics_StorageReader();
$summary_promise = $storage->get_history_summary_promise();
$c = Dispatcher::config();
if ($c->get_boolean('stats.enabled') && Util_Environment::is_w3tc_pro($c)) {
include W3TC_DIR . '/UsageStatistics_Widget_View.php';
} else {
include W3TC_DIR . '/UsageStatistics_Widget_View_Disabled.php';
}
}
示例6: parse
/**
* Parses FAQ XML file into array
*
* @return array
*/
public static function parse()
{
$config = Dispatcher::config();
$faq = array();
self::parse_file($faq, 'faq', '', '');
if (Util_Environment::is_w3tc_edge($config)) {
self::parse_file($faq, 'faq-edge', 'edge', '<b>Edge:</b> ');
}
if (Util_Environment::is_w3tc_pro($config)) {
self::parse_file($faq, 'faq-pro', 'pro', '<b>Pro:</b> ');
}
return $faq;
}
示例7: w3tc_settings_general_boxarea_cdn
public function w3tc_settings_general_boxarea_cdn()
{
$config = Dispatcher::config();
$engine_optgroups = array();
$engine_values = array();
$is_fsd = Util_Environment::is_w3tc_pro($config);
if ($is_fsd) {
$engine_optgroups[] = __('Full Site Delivery:', 'w3-total-cache');
$engine_values['cloudfront_fsd'] = array('label' => __('Amazon CloudFront', 'w3-total-cache'), 'optgroup' => 0);
$engine_values['maxcdn_fsd'] = array('label' => __('MaxCDN (recommended)', 'w3-total-cache'), 'optgroup' => 0);
$optgroup_pull = count($engine_optgroups);
$engine_optgroups[] = __('Origin Pull / Mirror:', 'w3-total-cache');
} else {
$optgroup_pull = count($engine_optgroups);
$engine_optgroups[] = __('Origin Pull / Mirror:', 'w3-total-cache');
}
$optgroup_push = count($engine_optgroups);
$engine_optgroups[] = __('Origin Push:', 'w3-total-cache');
$engine_values['akamai'] = array('label' => __('Akamai', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['cf2'] = array('label' => __('Amazon CloudFront', 'w3-total-cache'), 'disabled' => !Util_Installed::curl() ? true : null, 'optgroup' => $optgroup_pull);
$engine_values['att'] = array('label' => __('AT&T', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['cotendo'] = array('label' => __('Cotendo (Akamai)', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['mirror'] = array('label' => __('Generic Mirror', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['highwinds'] = array('label' => __('Highwinds', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['maxcdn'] = array('label' => __('MaxCDN', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['netdna'] = array('label' => __('MaxCDN Enterprise (NetDNA)', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['rackspace_cdn'] = array('label' => __('RackSpace CDN', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['edgecast'] = array('label' => __('Verizon Digital Media Services (EdgeCast) / Media Temple ProCDN', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
$engine_values['cf'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Amazon CloudFront', 'w3-total-cache'), 'optgroup' => $optgroup_push);
$engine_values['s3'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Amazon Simple Storage Service (S3)', 'w3-total-cache'), 'optgroup' => $optgroup_push);
$engine_values['s3_compatible'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Amazon Simple Storage Service (S3) Compatible', 'w3-total-cache'), 'optgroup' => $optgroup_push);
$engine_values['google_drive'] = array('label' => __('Google Drive', 'w3-total-cache'), 'optgroup' => $optgroup_push);
$engine_values['azure'] = array('label' => __('Microsoft Azure Storage', 'w3-total-cache'), 'optgroup' => $optgroup_push);
$engine_values['rscf'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Rackspace Cloud Files', 'w3-total-cache'), 'optgroup' => $optgroup_push);
$engine_values['ftp'] = array('disabled' => !Util_Installed::ftp() ? true : null, 'label' => __('Self-hosted / File Transfer Protocol Upload', 'w3-total-cache'), 'optgroup' => $optgroup_push);
$cdn_enabled = $config->get_boolean('cdn.enabled');
$cdn_engine = $config->get_string('cdn.engine');
$tag = '';
if ($cdn_engine == 'cloudfront_fsd') {
$tag = '#cdn-fsd-cloudfront';
} elseif ($cdn_engine == 'maxcdn_fsd') {
$tag = '#cdn-fsd-maxcdn';
}
if (empty($tag)) {
$cdn_engine_extra_description = '';
} else {
$cdn_engine_extra_description = ' See <a href="admin.php?page=w3tc_faq' . $tag . '">setup instructions</a>';
}
include W3TC_DIR . '/Cdn_GeneralPage_View.php';
}
示例8: w3tc_notes_wpml
public static function w3tc_notes_wpml($notes)
{
if (!self::show_notice()) {
return $notes;
}
$extension_id = 'wpml';
$config = Dispatcher::config();
if (!Util_Environment::is_w3tc_pro($config)) {
$activate_text = 'Available after <a href="#" class="button-buy-plugin">upgrade</a>. ';
} else {
$activate_text = sprintf('<a class="button" href="%s">Click here</a> to try it. ', Util_Ui::url(array('w3tc_extensions_activate' => $extension_id)));
}
$notes[$extension_id] = sprintf(__('Activating the <a href="%s">WPML</a> extension for W3 Total Cache may be helpful for your site. %s%s', 'w3-total-cache'), Util_Ui::admin_url('admin.php?page=w3tc_extensions#' . $extension_id), $activate_text, Util_Ui::button_link(__('Hide this message', 'w3-total-cache'), Util_Ui::url(array('w3tc_default_config_state' => 'y', 'key' => 'wpml.hide_note_suggest_activation', 'value' => 'true'))));
return $notes;
}
示例9: w3tc_extensions
/**
*
*
* @param unknown $extensions
* @param Config $config
* @return mixed
*/
public static function w3tc_extensions($extensions, $config)
{
$requirements = array();
if (!self::is_theme_found()) {
$requirements[] = 'Optimizes "Genesis Framework" version >= 1.9.0, which is not active';
}
if (empty($requirements) && !Util_Environment::is_w3tc_pro($config)) {
$requirements[] = 'Available after <a href="#" class="button-buy-plugin">upgrade</a>';
}
if (!$config->is_extension_active('fragmentcache')) {
$requirements[] = 'Activate "Fragment Cache" extension first';
}
$extensions['genesis.theme'] = array('name' => 'Genesis Framework by StudioPress', 'author' => 'W3 EDGE', 'description' => 'Provides 30-60% improvement in page generation time for the Genesis Framework by Copyblogger Media.', 'author_uri' => 'https://www.w3-edge.com/', 'extension_uri' => 'https://www.w3-edge.com/', 'extension_id' => 'genesis.theme', 'version' => '0.1', 'enabled' => empty($requirements), 'requirements' => implode(', ', $requirements), 'path' => 'w3-total-cache/Extension_Genesis_Plugin.php');
return $extensions;
}
示例10: w3tc_ajax_newrelic_list_applications
public function w3tc_ajax_newrelic_list_applications()
{
$api_key = $_REQUEST['api_key'];
$c = Dispatcher::config();
$details = array('api_key' => $api_key, 'monitoring_type' => $c->get_string(array('newrelic', 'monitoring_type')), 'apm.application_name' => $c->get_string(array('newrelic', 'apm.application_name')), 'browser.application_id' => $c->get_string(array('newrelic', 'browser.application_id')));
if ($details['monitoring_type'] != 'browser') {
$details['monitoring_type'] = 'apm';
}
$service = new Extension_NewRelic_Service($api_key);
try {
$details['apm_applications'] = $service->get_applications();
$api = new Extension_NewRelic_Api($api_key);
$details['browser_applications'] = $api->get_browser_applications();
} catch (\Exception $ex) {
$details = array('api_key' => $api_key, 'error_message' => 'API key verification failed: ' . $ex->getMessage());
$this->render_intro($details);
return;
}
$details['browser_disabled'] = !Util_Environment::is_w3tc_pro($c);
include W3TC_DIR . '/Extension_NewRelic_Popup_View_ListApplications.php';
}
示例11: run
/**
* Runs plugin
*/
function run()
{
add_filter('w3tc_config_default_values', array($this, 'w3tc_config_default_values'));
$config = Dispatcher::config();
// remainder only when extension is frontend-active
if (!$config->is_extension_active_frontend('fragmentcache')) {
return;
}
add_action('init', array($this, 'on_init'), 9999999);
add_filter('cron_schedules', array($this, 'cron_schedules'));
add_filter('w3tc_footer_comment', array($this, 'w3tc_footer_comment'));
if ($this->_config->get_string(array('fragmentcache', 'engine')) == 'file') {
add_action('w3_fragmentcache_cleanup', array($this, 'cleanup'));
}
add_action('switch_blog', array($this, 'switch_blog'), 0, 2);
$groups = $this->_config->get_array(array('fragmentcache', 'groups'));
foreach ($groups as $group) {
$split = explode(',', $group);
$group = array_shift($split);
$actions = $split;
$this->_core->register_group($group, $actions, $this->_config->get_integer(array('fragmentcache', 'lifetime')));
}
// handle transients by own cache
if (Util_Environment::is_w3tc_pro($this->_config)) {
$wp_cache = Dispatcher::component('ObjectCache_WpObjectCache');
$fc_cache = Dispatcher::component('Extension_FragmentCache_WpObjectCache');
$wp_cache->register_cache($fc_cache, array('transient', 'site-transient'));
}
// flush operations
add_action('w3tc_flush_all', array($this, 'w3tc_flush_all'), 300);
add_action('w3tc_flush_fragmentcache', array($this, 'w3tc_flush_fragmentcache'));
add_action('w3tc_flush_fragmentcache_group', array($this, 'w3tc_flush_fragmentcache_group'), 10, 2);
// usage statistics handling
add_action('w3tc_usage_statistics_of_request', array($this, 'w3tc_usage_statistics_of_request'), 10, 1);
add_filter('w3tc_usage_statistics_metrics', array($this, 'w3tc_usage_statistics_metrics'));
}
示例12:
<?php
$this->checkbox_debug('dbcache.debug');
?>
<?php
Util_Ui::e_config_label('dbcache.debug');
?>
</label><br />
<?php
$this->checkbox_debug('objectcache.debug');
?>
<?php
Util_Ui::e_config_label('objectcache.debug');
?>
</label><br />
<?php
if (Util_Environment::is_w3tc_pro($this->_config)) {
?>
<?php
$this->checkbox_debug(array('fragmentcache', 'debug'));
?>
<?php
_e('Fragment Cache', 'w3-total-cache');
?>
</label><br />
<?php
}
?>
<?php
$this->checkbox_debug('cdn.debug');
?>
<?php
示例13:
<?php
namespace W3TC;
if (!defined('W3TC')) {
die;
}
$is_pro = Util_Environment::is_w3tc_pro($this->_config);
$this->checkbox('minify.css.strip.comments', false, 'css_');
?>
<?php
Util_Ui::e_config_label('minify.css.strip.comments');
?>
</label><br />
<?php
$this->checkbox('minify.css.strip.crlf', false, 'css_');
?>
<?php
Util_Ui::e_config_label('minify.css.strip.crlf');
?>
</label><br />
<?php
$this->checkbox('minify.css.embed', !$is_pro, 'csse_', true, $is_pro ? null : false);
?>
Eliminate render-blocking CSS by moving it to HTML body</label>
<?php
if (!$is_pro) {
echo ' (Available after <a href="#" class="button-buy-plugin">upgrade</a>)';
}
?>
<br />
示例14: w3tc_edition
/**
*
*
* @var Config $config
* @return string
*/
public static function w3tc_edition($config = null)
{
if (Util_Environment::is_w3tc_enterprise($config)) {
return 'enterprise';
}
if (Util_Environment::is_w3tc_pro($config) && Util_Environment::is_w3tc_pro_dev()) {
return 'pro development';
}
if (Util_Environment::is_w3tc_pro($config)) {
return 'pro';
}
return 'community';
}
示例15: w3tc_config_save_support_us
/**
* Save support us action
*
* @return void
*/
function w3tc_config_save_support_us()
{
$support = Util_Request::get_string('support');
$tweeted = Util_Request::get_boolean('tweeted');
$signmeup = Util_Request::get_boolean('signmeup');
$track_usage = Util_Request::get_boolean('track_usage');
$this->_config->set('common.support', $support);
$this->_config->set('common.tweeted', $tweeted);
if ($track_usage) {
$this->_config->set('common.track_usage', true);
}
if ($signmeup) {
if (Util_Environment::is_w3tc_enterprise($this->_config)) {
$license = 'enterprise';
} elseif (Util_Environment::is_w3tc_pro($this->_config)) {
$license = 'pro';
} else {
$license = 'community';
}
$email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
wp_remote_post(W3TC_MAILLINGLIST_SIGNUP_URL, array('body' => array('email' => $email, 'license' => $license)));
}
$this->_config->save();
Generic_AdminLinks::link_update($this->_config);
Util_Admin::redirect(array('w3tc_note' => 'config_save'));
}