本文整理汇总了PHP中w3_zlib_output_compression函数的典型用法代码示例。如果您正苦于以下问题:PHP w3_zlib_output_compression函数的具体用法?PHP w3_zlib_output_compression怎么用?PHP w3_zlib_output_compression使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了w3_zlib_output_compression函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _get_compression
/**
* Checks gzip availability
*
* @return boolean
*/
function _get_compression()
{
if (!w3_zlib_output_compression() && !headers_sent() && !$this->_is_buggy_ie()) {
$compressions = $this->_get_compressions();
foreach ($compressions as $compression) {
if (stristr($_SERVER['HTTP_ACCEPT_ENCODING'], $compression) !== false) {
return $compression;
}
}
}
return false;
}
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:17,代码来源:PgCache.php
示例2: _get_compression
/**
* Returns current compression
*
* @return boolean
*/
function _get_compression()
{
if ($this->_debug) {
// cannt generate/use compressed files during debug mode
return false;
}
if (!w3_zlib_output_compression() && !headers_sent() && !$this->_is_buggy_ie()) {
$compressions = $this->_get_compressions();
foreach ($compressions as $compression) {
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && stristr($_SERVER['HTTP_ACCEPT_ENCODING'], $compression) !== false) {
return $compression;
}
}
}
return false;
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:21,代码来源:PgCache.php
示例3: 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'));
}
/**
//.........这里部分代码省略.........
开发者ID:easinewe,项目名称:Avec2016,代码行数:101,代码来源:PluginView.php
示例4: options
//.........这里部分代码省略.........
if (!$this->is_memcache_available($objectcache_memcached_servers)) {
$memcaches_errors[] = sprintf('Object Cache: %s.', implode(', ', $objectcache_memcached_servers));
}
}
if (count($memcaches_errors)) {
$memcache_error = 'The following memcached servers are not responding or not running:</p><ul>';
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.';
$this->_errors[] = $memcache_error;
}
/**
* Check PHP version
*/
if (!W3TC_PHP5 && $this->_config->get_boolean('notes.php_is_old')) {
$this->_notes[] = sprintf('Unfortunately, <strong>PHP5</strong> is required for full functionality of this plugin; incompatible features are automatically disabled. Please upgrade if possible. %s', $this->button_hide_note('Hide this message', 'php_is_old'));
}
/**
* 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', $this->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', $this->button_hide_note('Hide this message', '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', $this->button_hide_note('Hide this message', 'zlib_output_compression'));
}
/**
* Check wp-content permissions
*/
if (!W3TC_WIN && $this->_config->get_boolean('notes.wp_content_perms')) {
$wp_content_stat = stat(WP_CONTENT_DIR);
$wp_content_mode = $wp_content_stat['mode'] & 0777;
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>. %s', WP_CONTENT_DIR, WP_CONTENT_DIR, $this->button_hide_note('Hide this message', 'wp_content_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', $this->button_hide_note('Hide this message', 'no_permalink_rules'));
}
/**
* CDN
*/
if ($this->_config->get_boolean('cdn.enabled')) {
/**
* Check upload settings
*/
$upload_info = w3_upload_info();
if (!$upload_info) {
$upload_path = get_option('upload_path');
$upload_path = trim($upload_path);
if (empty($upload_path)) {
$upload_path = WP_CONTENT_DIR . '/uploads';
$this->_errors[] = sprintf('The uploads directory is not available. Default WordPress directories will be created: <strong>%s</strong>.', $upload_path);
开发者ID:niko-lgdcom,项目名称:archives,代码行数:67,代码来源:TotalCache.php
示例5: getAcceptedEncoding
/**
* Determine the client's best encoding method from the HTTP Accept-Encoding
* header.
*
* If no Accept-Encoding header is set, or the browser is IE before v6 SP2,
* this will return ('', ''), the "identity" encoding.
*
* A syntax-aware scan is done of the Accept-Encoding, so the method must
* be non 0. The methods are favored in order of gzip, deflate, then
* compress. Deflate is always smallest and generally faster, but is
* rarely sent by servers, so client support could be buggier.
*
* @param bool $allowCompress allow the older compress encoding
*
* @param bool $allowDeflate allow the more recent deflate encoding
*
* @return array two values, 1st is the actual encoding method, 2nd is the
* alias of that method to use in the Content-Encoding header (some browsers
* call gzip "x-gzip" etc.)
*/
public static function getAcceptedEncoding($allowCompress = true, $allowDeflate = true)
{
// @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) || w3_zlib_output_compression() || headers_sent() || self::_isBuggyIe()) {
return array('', '');
}
$ae = $_SERVER['HTTP_ACCEPT_ENCODING'];
// gzip checks (quick)
if (0 === strpos($ae, 'gzip,') || 0 === strpos($ae, 'deflate, gzip,')) {
return array('gzip', 'gzip');
}
// gzip checks (slow)
if (preg_match('@(?:^|,)\\s*((?:x-)?gzip)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@', $ae, $m)) {
return array('gzip', $m[1]);
}
if ($allowDeflate) {
// deflate checks
$aeRev = strrev($ae);
if (0 === strpos($aeRev, 'etalfed ,') || 0 === strpos($aeRev, 'etalfed,') || 0 === strpos($ae, 'deflate,') || preg_match('@(?:^|,)\\s*deflate\\s*(?:$|,|;\\s*q=(?:0\\.|1))@', $ae)) {
return array('deflate', 'deflate');
}
}
if ($allowCompress && preg_match('@(?:^|,)\\s*((?:x-)?compress)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@', $ae, $m)) {
return array('compress', $m[1]);
}
return array('', '');
}
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:47,代码来源:Encoder.php
示例6: getAcceptedEncoding
/**
* Determine the client's best encoding method from the HTTP Accept-Encoding
* header.
*
* If no Accept-Encoding header is set, or the browser is IE before v6 SP2,
* this will return ('', ''), the "identity" encoding.
*
* A syntax-aware scan is done of the Accept-Encoding, so the method must
* be non 0. The methods are favored in order of gzip, deflate, then
* compress. Deflate is always smallest and generally faster, but is
* rarely sent by servers, so client support could be buggier.
*
* @return array two values, 1st is the actual encoding method, 2nd is the
* alias of that method to use in the Content-Encoding header (some browsers
* call gzip "x-gzip" etc.)
*/
public static function getAcceptedEncoding()
{
// @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) || w3_zlib_output_compression() || headers_sent() || self::_isBuggyIe()) {
return array('', '');
}
if (stristr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode')) {
return array('gzip', 'gzip');
}
return array('', '');
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:27,代码来源:Encoder.php
示例7: options
/**
* Options page
*/
function options()
{
/**
* Check for page cache availability
*/
if ($this->_config->get_boolean('pgcache.enabled')) {
if (!$this->check_advanced_cache()) {
$this->_errors[] = sprintf('Page caching is not available: advanced-cache.php is not installed. Either the <strong>%s</strong> directory is not write-able or you have another caching plugin installed. This error message will automatically disappear once the change is successfully made.', WP_CONTENT_DIR);
} elseif (!defined('WP_CACHE')) {
$this->_errors[] = sprintf('Page caching is not available: please add: <strong>define(\'WP_CACHE\', true);</strong> to <strong>%swp-config.php</strong>. This error message will automatically disappear once the change is successfully made.', ABSPATH);
} else {
switch ($this->_config->get_string('pgcache.engine')) {
case 'file_pgcache':
require_once W3TC_LIB_W3_DIR . '/Plugin/PgCache.php';
$w3_plugin_pgcache =& W3_Plugin_PgCache::instance();
if ($this->_config->get_boolean('notes.pgcache_rules_core') && !$w3_plugin_pgcache->check_rules_core()) {
if (w3_is_wpmu()) {
$this->_errors[] = sprintf('Enhanced mode page cache is not operational. Your .htaccess rules could not be modified. Please verify <strong>%s.htaccess</strong> has the following rules: <pre>%s</pre> %s', ABSPATH, htmlspecialchars($w3_plugin_pgcache->generate_rules_core()), $this->button_hide_note('Hide this message', 'pgcache_rules_core'));
} else {
$this->_errors[] = sprintf('You\'ve selected disk caching with enhanced mode however the .htaccess file is not properly configured. Please run <strong>chmod 777 %s.htaccess</strong>, then %s. To manually modify your server configuration for enhanced mode append the following code: <pre>%s</pre> and %s.', ABSPATH, $this->button_link('try again', sprintf('options-general.php?page=%s&tab=%s&pgcache_write_rules_core', W3TC_FILE, $this->_tab)), htmlspecialchars($w3_plugin_pgcache->generate_rules_core()), $this->button_hide_note('hide this message', 'pgcache_rules_core'));
}
}
if ($this->_config->get_boolean('notes.pgcache_rules_cache') && !$w3_plugin_pgcache->check_rules_cache()) {
$this->_errors[] = sprintf('You\'ve selected disk caching with enhanced mode however the .htaccess file is not properly configured. Please run <strong>chmod 777 %s/.htaccess</strong>, then %s. To manually modify your server configuration for enhanced mode append the following code: <pre>%s</pre> and %s.', W3TC_CACHE_FILE_PGCACHE_DIR, $this->button_link('try again', sprintf('options-general.php?page=%s&tab=%s&pgcache_write_rules_cache', W3TC_FILE, $this->_tab)), htmlspecialchars($w3_plugin_pgcache->generate_rules_cache()), $this->button_hide_note('hide this message', 'pgcache_rules_cache'));
}
break;
case 'memcached':
$pgcache_memcached_servers = $this->_config->get_array('pgcache.memcached.servers');
if (!$this->is_memcache_available($pgcache_memcached_servers)) {
$this->_errors[] = sprintf('Page caching is not working properly. Memcached server(s): <strong>%s</strong> may not running or not responding. This error message will automatically disappear once the issue is resolved.', implode(', ', $pgcache_memcached_servers));
}
break;
}
}
}
/**
* Check for minify availability
*/
if ($this->_config->get_boolean('minify.enabled')) {
switch ($this->_config->get_string('minify.engine')) {
case 'file':
if (W3TC_PHP5) {
require_once W3TC_LIB_W3_DIR . '/Plugin/Minify.php';
$w3_plugin_minify =& W3_Plugin_Minify::instance();
if ($this->_config->get_boolean('notes.minify_rules') && !$w3_plugin_minify->check_rules()) {
$this->_errors[] = sprintf('The "Rewrite URL Structure" feature, requires rewrite rules be present. Please run <strong>chmod 777 %s/.htaccess</strong>, then %s. To manually modify your server configuration for minify append the following code: <pre>%s</pre> and %s.', W3TC_CACHE_FILE_MINIFY_DIR, $this->button_link('try again', sprintf('options-general.php?page=%s&tab=%s&minify_write_rules', W3TC_FILE, $this->_tab)), htmlspecialchars($w3_plugin_minify->generate_rules()), $this->button_hide_note('hide this message', 'minify_rules'));
}
}
break;
case 'memcached':
$minify_memcached_servers = $this->_config->get_array('minify.memcached.servers');
if (!$this->is_memcache_available($minify_memcached_servers)) {
$this->_errors[] = sprintf('Minify is not working properly. Memcached server(s): <strong>%s</strong> may not running or not responding. This error message will automatically disappear once the issue is resolved.', implode(', ', $minify_memcached_servers));
}
break;
}
}
/**
* Check for database cache availability
*/
if ($this->_config->get_boolean('dbcache.enabled')) {
if (!$this->check_db()) {
$this->_errors[] = sprintf('Database caching is not available: db.php is not installed. Either the <strong>%s</strong> directory is not write-able or you have another caching plugin installed. This error message will automatically disappear once the change is successfully made.', WP_CONTENT_DIR);
} elseif ($this->_config->get_string('pgcache.engine') == 'memcached') {
$dbcache_memcached_servers = $this->_config->get_array('dbcache.memcached.servers');
if (!$this->is_memcache_available($dbcache_memcached_servers)) {
$this->_errors[] = sprintf('Database caching is not working properly. Memcached server(s): <strong>%s</strong> may not running or not responding. This error message will automatically disappear once the issue is successfully resolved.', implode(', ', $dbcache_memcached_servers));
}
}
}
/**
* Check PHP version
*/
if (!W3TC_PHP5 && $this->_config->get_boolean('notes.php_is_old')) {
$this->_notes[] = sprintf('Unfortunately, <strong>PHP5</strong> is required for full functionality of this plugin; incompatible features are automatically disabled. Please upgrade if possible. %s', $this->button_hide_note('Hide this message', 'php_is_old'));
}
/**
* 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', $this->button_hide_note('Hide this message', 'no_curl'));
}
/**
* Check Zlib extension
*/
if ($this->_config->get_boolean('notes.no_zlib') && (!function_exists('gzencode') || !function_exists('gzdeflate'))) {
$this->_notes[] = sprintf('Unfortunately the PHP installation is incomplete, the <strong>zlib module is missing</strong>. This is a core PHP module. Please notify your server administrator and ask for it to be installed. %s', $this->button_hide_note('Hide this message', '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 somewhere in your WordPress installation is has set <strong>zlib.output_compression</strong> to enabled.<br />Please locate and disable this setting to ensure proper HTTP compression management. %s', $this->button_hide_note('Hide this message', 'zlib_output_compression'));
}
/**
* Show message when defaults are set
*/
//.........这里部分代码省略.........
开发者ID:alx,项目名称:SBek-Arak,代码行数:101,代码来源:TotalCache.php
示例8: options
//.........这里部分代码省略.........
if (!$this->is_memcache_available($objectcache_memcached_servers)) {
$memcaches_errors[] = sprintf('Object Cache: %s.', implode(', ', $objectcache_memcached_servers));
}
}
if (count($memcaches_errors)) {
$memcache_error = 'The following memcached servers are not responding or not running:</p><ul>';
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.';
$this->_errors[] = $memcache_error;
}
/**
* Check PHP version
*/
if (!W3TC_PHP5 && $this->_config->get_boolean('notes.php_is_old')) {
$this->_notes[] = sprintf('Unfortunately, <strong>PHP5</strong> is required for full functionality of this plugin; incompatible features are automatically disabled. Please upgrade if possible. %s', $this->button_hide_note('Hide this message', 'php_is_old'));
}
/**
* 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', $this->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', $this->button_hide_note('Hide this message', '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', $this->button_hide_note('Hide this message', 'zlib_output_compression'));
}
/**
* Check wp-content permissions
*/
if (!W3TC_WIN && $this->_config->get_boolean('notes.wp_content_perms')) {
$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', WP_CONTENT_DIR, WP_CONTENT_DIR, base_convert(w3_get_file_permissions(WP_CONTENT_DIR), 10, 8), $this->button_hide_note('Hide this message', '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', WP_CONTENT_DIR, base_convert($current_perm, 10, 8), $perm, WP_CONTENT_DIR, $this->button_hide_note('Hide this message', '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', $this->button_hide_note('Hide this message', 'no_permalink_rules'));
}
/**
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:67,代码来源:TotalCacheAdmin.php
注:本文中的w3_zlib_output_compression函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论