本文整理汇总了PHP中W3_Config::is_preview方法的典型用法代码示例。如果您正苦于以下问题:PHP W3_Config::is_preview方法的具体用法?PHP W3_Config::is_preview怎么用?PHP W3_Config::is_preview使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类W3_Config
的用法示例。
在下文中一共展示了W3_Config::is_preview方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: options
function options()
{
$remove_results = array();
$w3tc_error = array();
w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
$preview = $this->_config->is_preview();
if (w3_is_network() && !$this->is_master()) {
$this->_config_master = new W3_Config(true);
} else {
$this->_config_master = $this->_config;
}
/**
* Check for page cache availability
*/
$wp_config_edit = false;
/**
* Check memcached
*/
$memcaches_errors = array();
if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'memcached') {
$pgcache_memcached_servers = $this->_config->get_array('pgcache.memcached.servers');
if (!$this->is_memcache_available($pgcache_memcached_servers)) {
$memcaches_errors[] = sprintf(__('Page Cache: %s.', 'w3-total-cache'), implode(', ', $pgcache_memcached_servers));
}
}
if ($this->_config->get_boolean('minify.enabled') && $this->_config->get_string('minify.engine') == 'memcached') {
$minify_memcached_servers = $this->_config->get_array('minify.memcached.servers');
if (!$this->is_memcache_available($minify_memcached_servers)) {
$memcaches_errors[] = sprintf(__('Minify: %s.', 'w3-total-cache'), implode(', ', $minify_memcached_servers));
}
}
if ($this->_config->get_boolean('dbcache.enabled') && $this->_config->get_string('dbcache.engine') == 'memcached') {
$dbcache_memcached_servers = $this->_config->get_array('dbcache.memcached.servers');
if (!$this->is_memcache_available($dbcache_memcached_servers)) {
$memcaches_errors[] = sprintf(__('Database Cache: %s.', 'w3-total-cache'), implode(', ', $dbcache_memcached_servers));
}
}
if ($this->_config->get_boolean('objectcache.enabled') && $this->_config->get_string('objectcache.engine') == 'memcached') {
$objectcache_memcached_servers = $this->_config->get_array('objectcache.memcached.servers');
if (!$this->is_memcache_available($objectcache_memcached_servers)) {
$memcaches_errors[] = sprintf(__('Object Cache: %s.', 'w3-total-cache'), implode(', ', $objectcache_memcached_servers));
}
}
if (count($memcaches_errors)) {
$memcache_error = __('The following memcached servers are not responding or not running:</p><ul>', 'w3-total-cache');
foreach ($memcaches_errors as $memcaches_error) {
$memcache_error .= '<li>' . $memcaches_error . '</li>';
}
$memcache_error .= __('</ul><p>This message will automatically disappear once the issue is resolved.', 'w3-total-cache');
$this->_errors[] = $memcache_error;
}
/**
* Check CURL extension
*/
if ($this->_config->get_boolean('notes.no_curl') && $this->_config->get_boolean('cdn.enabled') && !function_exists('curl_init')) {
$this->_notes[] = sprintf(__('The <strong>CURL PHP</strong> extension is not available. Please install it to enable S3 or CloudFront functionality. %s', 'w3-total-cache'), w3_button_hide_note('Hide this message', 'no_curl'));
}
/**
* Check Zlib extension
*/
if ($this->_config->get_boolean('notes.no_zlib') && !function_exists('gzencode')) {
$this->_notes[] = sprintf(__('Unfortunately the PHP installation is incomplete, the <strong>zlib module is missing</strong>. This is a core PHP module. Notify the server administrator. %s', 'w3-total-cache'), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'no_zlib'));
}
/**
* Check if Zlib output compression is enabled
*/
if ($this->_config->get_boolean('notes.zlib_output_compression') && w3_zlib_output_compression()) {
$this->_notes[] = sprintf(__('Either the PHP configuration, web server configuration or a script in the WordPress installation has <strong>zlib.output_compression</strong> enabled.<br />Please locate and disable this setting to ensure proper HTTP compression behavior. %s', 'w3-total-cache'), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'zlib_output_compression'));
}
/**
* Check wp-content permissions
*/
if (!W3TC_WIN && $this->_config->get_boolean('notes.wp_content_perms')) {
w3_require_once(W3TC_INC_DIR . '/functions/file.php');
$wp_content_mode = w3_get_file_permissions(WP_CONTENT_DIR);
if ($wp_content_mode > 0755) {
$this->_notes[] = sprintf(__('<strong>%s</strong> is write-able. When finished installing the plugin,
change the permissions back to the default: <strong>chmod 755 %s</strong>.
Permissions are currently %s. %s', 'w3-total-cache'), WP_CONTENT_DIR, WP_CONTENT_DIR, base_convert(w3_get_file_permissions(WP_CONTENT_DIR), 10, 8), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'wp_content_perms'));
}
}
/**
* Check wp-content permissions
*/
if (!W3TC_WIN && $this->_config->get_boolean('notes.wp_content_changed_perms')) {
$perm = get_transient('w3tc_prev_permission');
$current_perm = w3_get_file_permissions(WP_CONTENT_DIR);
if ($perm && $perm != base_convert($current_perm, 10, 8) && ($current_perm > 0755 || $perm < base_convert($current_perm, 10, 8))) {
$this->_notes[] = sprintf(__('<strong>%s</strong> permissions were changed during the setup process.
Permissions are currently %s.<br />To restore permissions run
<strong>chmod %s %s</strong>. %s', 'w3-total-cache'), WP_CONTENT_DIR, base_convert($current_perm, 10, 8), $perm, WP_CONTENT_DIR, w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'wp_content_changed_perms'));
}
}
/**
* Check permalinks
*/
if ($this->_config->get_boolean('notes.no_permalink_rules') && ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_generic' || $this->_config->get_boolean('browsercache.enabled') && $this->_config->get_boolean('browsercache.no404wp')) && !w3_is_permalink_rules()) {
$this->_errors[] = sprintf(__('The required directives for fancy permalinks could not be detected, please confirm they are available: <a href="http://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29">Creating and editing</a> %s', 'w3-total-cache'), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'no_permalink_rules'));
}
/**
//.........这里部分代码省略.........