本文整理汇总了PHP中w3_is_multisite函数的典型用法代码示例。如果您正苦于以下问题:PHP w3_is_multisite函数的具体用法?PHP w3_is_multisite怎么用?PHP w3_is_multisite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了w3_is_multisite函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fix_in_wpadmin
function fix_in_wpadmin($config, $force_all_checks = false)
{
$exs = new SelfTestExceptions();
$fix_on_event = false;
if (w3_is_multisite() && w3_get_blog_id() != 0) {
if (get_transient('w3tc_config_changes') != ($md5_string = $config->get_md5())) {
$fix_on_event = true;
set_transient('w3tc_config_changes', $md5_string, 3600);
}
}
// call plugin-related handlers
foreach ($this->get_handlers($config) as $h) {
try {
$h->fix_on_wpadmin_request($config, $force_all_checks);
if ($fix_on_event) {
$this->fix_on_event($config, 'admin_request');
}
} catch (SelfTestExceptions $ex) {
$exs->push($ex);
}
}
if (count($exs->exceptions()) > 0) {
throw $exs;
}
}
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:25,代码来源:AdminEnvironment.php
示例2: run
/**
* Runs plugin
*/
function run()
{
add_action('publish_phone', array(&$this, 'on_post_edit'), 20);
add_action('wp_trash_post', array(&$this, 'on_post_change'), 20);
add_action('save_post', array(&$this, 'on_post_change'), 20);
global $wp_version;
if (version_compare($wp_version, '3.5', '>=')) {
add_action('clean_post_cache', array(&$this, 'on_post_change'), 20, 2);
}
add_action('comment_post', array(&$this, 'on_comment_change'), 20);
add_action('edit_comment', array(&$this, 'on_comment_change'), 20);
add_action('delete_comment', array(&$this, 'on_comment_change'), 0);
add_action('wp_set_comment_status', array(&$this, 'on_comment_status'), 20, 2);
add_action('trackback_post', array(&$this, 'on_comment_change'), 20);
add_action('pingback_post', array(&$this, 'on_comment_change'), 20);
add_action('switch_theme', array(&$this, 'on_change'), 20);
add_action('wp_update_nav_menu', array(&$this, 'on_change'), 20);
add_action('edit_user_profile_update', array(&$this, 'on_change'), 20);
add_action('w3tc_purge_from_pgcache', array(&$this, 'on_post_change'), 20);
add_action('delete_post', array(&$this, 'on_post_edit'), 20);
if (w3_is_multisite()) {
add_action('delete_blog', array(&$this, 'on_change'), 20);
}
add_filter('wp_redirect', array(&$this, 'on_redirect_cleanup'), 20, 1);
add_action('sns_actions_executed', array(&$this, 'flush_post_cleanup'), 20);
}
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:29,代码来源:CdnCache.php
示例3: run
/**
* Runs plugin
*/
function run()
{
add_filter('cron_schedules', array(&$this, 'cron_schedules'));
if ($this->_config->get_string('dbcache.engine') == 'file') {
add_action('w3_dbcache_cleanup', array(&$this, 'cleanup'));
}
add_action('publish_phone', array(&$this, 'on_change'), 0);
add_action('wp_trash_post', array(&$this, 'on_post_change'), 0);
add_action('save_post', array(&$this, 'on_post_change'), 0);
global $wp_version;
if (version_compare($wp_version, '3.5', '>=')) {
add_action('clean_post_cache', array(&$this, 'on_post_change'), 0, 2);
}
add_action('comment_post', array(&$this, 'on_comment_change'), 0);
add_action('edit_comment', array(&$this, 'on_comment_change'), 0);
add_action('delete_comment', array(&$this, 'on_comment_change'), 0);
add_action('wp_set_comment_status', array(&$this, 'on_comment_status'), 0, 2);
add_action('trackback_post', array(&$this, 'on_comment_change'), 0);
add_action('pingback_post', array(&$this, 'on_comment_change'), 0);
add_action('switch_theme', array(&$this, 'on_change'), 0);
add_action('edit_user_profile_update', array(&$this, 'on_change'), 0);
if (w3_is_multisite()) {
add_action('delete_blog', array(&$this, 'on_change'), 0);
}
add_action('delete_post', array(&$this, 'on_post_change'), 0);
}
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:29,代码来源:DbCache.php
示例4: view
/**
* General tab
*
* @return void
*/
function view()
{
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php');
global $current_user;
$config_master = $this->_config_master;
/**
* @var $modules W3_ModuleStatus
*/
$modules = w3_instance('W3_ModuleStatus');
$pgcache_enabled = $modules->is_enabled('pgcache');
$dbcache_enabled = $modules->is_enabled('dbcache');
$objectcache_enabled = $modules->is_enabled('objectcache');
$browsercache_enabled = $modules->is_enabled('browsercache');
$minify_enabled = $modules->is_enabled('minify');
$cdn_enabled = $modules->is_enabled('cdn');
$varnish_enabled = $modules->is_enabled('varnish');
$fragmentcache_enabled = $modules->is_enabled('fragmentcache');
$enabled = $modules->plugin_is_enabled();
$enabled_checkbox = $modules->all_modules_enabled();
$check_rules = w3_can_check_rules();
$check_apc = function_exists('apc_store');
$check_eaccelerator = function_exists('eaccelerator_put');
$check_xcache = function_exists('xcache_set');
$check_wincache = function_exists('wincache_ucache_set');
$check_curl = function_exists('curl_init');
$check_memcached = class_exists('Memcache');
$check_ftp = function_exists('ftp_connect');
$check_tidy = class_exists('tidy');
$disc_enhanced_enabled = !(!$check_rules || !$this->is_master() && w3_is_network() && $config_master->get_string('pgcache.engine') != 'file_generic');
$can_empty_file = $modules->can_empty_file();
$can_empty_varnish = $modules->can_empty_varnish();
$cdn_mirror_purge = w3_cdn_can_purge_all($modules->get_module_engine('cdn'));
$file_nfs = $this->_config->get_boolean('pgcache.file.nfs') || $this->_config->get_boolean('minify.file.nfs');
$file_locking = $this->_config->get_boolean('dbcache.file.locking') || $this->_config->get_boolean('objectcache.file.locking') || $this->_config->get_boolean('pgcache.file.locking') || $this->_config->get_boolean('minify.file.locking');
w3_require_once(W3TC_LIB_NEWRELIC_DIR . '/NewRelicWrapper.php');
$newrelic_conf_appname = NewRelicWrapper::get_wordpress_appname($this->_config, $this->_config_master, false);
$newrelic_applications = array();
$nerser = w3_instance('W3_NewRelicService');
$new_relic_installed = $nerser->module_is_enabled();
$new_relic_running = true;
if ($this->_config->get_boolean('newrelic.enabled')) {
$new_relic_configured = $this->_config->get_string('newrelic.api_key') && $this->_config->get_string('newrelic.account_id');
$newrelic_prefix = '';
if ($new_relic_configured) {
if (w3_is_network()) {
$newrelic_prefix = $this->_config->get_string('newrelic.appname_prefix');
}
try {
$newrelic_applications = $nerser->get_applications();
} catch (Exception $ex) {
}
$newrelic_application = $this->_config->get_string('newrelic.application_id');
}
}
$licensing_visible = (!w3_is_multisite() || is_network_admin()) && !ini_get('w3tc.license_key') && get_transient('w3tc_license_status') != 'host_valid';
$custom_areas = apply_filters("{$this->_page}_anchors", array());
include W3TC_INC_DIR . '/options/general.php';
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:63,代码来源:GeneralAdminView.php
示例5: admin_init
/**
* Setup notices actions
*/
function admin_init()
{
if (current_user_can('manage_options')) {
if (is_admin() && isset($_GET['page']) && strpos($_GET['page'], 'w3tc_') !== false) {
/**
* Only admin can see W3TC notices and errors
*/
if (!w3_is_multisite()) {
add_action('admin_notices', array(&$this, 'admin_notices'));
}
add_action('network_admin_notices', array(&$this, 'admin_notices'));
}
}
}
开发者ID:rongandat,项目名称:sallumeh,代码行数:17,代码来源:Licensing.php
示例6: admin_init
/**
* Setup notices actions
*/
function admin_init()
{
if (current_user_can('manage_options')) {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php');
if (is_admin() && is_w3tc_admin_page()) {
/**
* Only admin can see W3TC notices and errors
*/
if (!w3_is_multisite()) {
add_action('admin_notices', array(&$this, 'admin_notices'));
}
add_action('network_admin_notices', array(&$this, 'admin_notices'));
}
}
}
开发者ID:jfbelisle,项目名称:magexpress,代码行数:18,代码来源:Licensing.php
示例7: view
/**
* Page cache tab
*
* @return void
*/
function view()
{
global $wp_rewrite;
$feeds = $wp_rewrite->feeds;
$feed_key = array_search('feed', $feeds);
if ($feed_key !== false) {
unset($feeds[$feed_key]);
}
$default_feed = get_default_feed();
$pgcache_enabled = $this->_config->get_boolean('pgcache.enabled');
$permalink_structure = get_option('permalink_structure');
$varnish_enabled = $this->_config->get_boolean('varnish.enabled');
$cdn_mirror_purge_enabled = w3_is_cdn_mirror($this->_config->get_string('cdn.engine')) && $this->_config->get_string('cdn.engine') != 'mirror' && $this->_config->get_boolean('cdncache.enabled') && w3tc_edge_mode() && w3_is_pro($this->_config) || w3_is_enterprise();
$disable_check_domain = w3_is_multisite() && w3_force_master();
include W3TC_INC_DIR . '/options/pgcache.php';
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:21,代码来源:PgCacheAdminView.php
示例8: print_script
function print_script()
{
?>
<script type="text/javascript">
var w3_use_network_link = <?php
echo is_network_admin() || w3_is_multisite() && w3_force_master() ? 'true' : 'false';
?>
;
function w3tc_start_minify_try_solve() {
var testUrl = '<?php
echo w3_filename_to_url(w3_cache_blog_dir('minify') . '/', w3_get_domain(w3_get_home_url()) != w3_get_domain(w3_get_site_url()));
?>
';
w3tc_filename_auto_solve(testUrl);
}
</script>
<?php
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:18,代码来源:MinifyAdmin.php
示例9: run
/**
* Runs plugin
*/
function run()
{
add_filter('cron_schedules', array(&$this, 'cron_schedules'));
if ($this->_config->get_string('pgcache.engine') == 'file' || $this->_config->get_string('pgcache.engine') == 'file_generic') {
add_action('w3_pgcache_cleanup', array(&$this, 'cleanup'));
}
add_action('w3_pgcache_prime', array(&$this, 'prime'));
add_action('publish_phone', array(&$this, 'on_post_edit'), 0);
add_action('wp_trash_post', array(&$this, 'on_post_change'), 0);
add_action('save_post', array(&$this, 'on_post_change'), 0);
global $wp_version;
if (version_compare($wp_version, '3.5', '>=')) {
add_action('clean_post_cache', array(&$this, 'on_post_change'), 0, 2);
}
add_action('comment_post', array(&$this, 'on_comment_change'), 0);
add_action('edit_comment', array(&$this, 'on_comment_change'), 0);
add_action('delete_comment', array(&$this, 'on_comment_change'), 0);
add_action('wp_set_comment_status', array(&$this, 'on_comment_status'), 0, 2);
add_action('trackback_post', array(&$this, 'on_comment_change'), 0);
add_action('pingback_post', array(&$this, 'on_comment_change'), 0);
add_action('switch_theme', array(&$this, 'on_change'), 0);
add_action('wp_update_nav_menu', array(&$this, 'on_change'), 0);
add_action('edit_user_profile_update', array(&$this, 'on_change'), 0);
add_filter('comment_cookie_lifetime', array(&$this, 'comment_cookie_lifetime'));
add_action('w3tc_purge_from_pgcache', array(&$this, 'on_post_change'), 0);
if (w3_is_multisite()) {
add_action('delete_blog', array(&$this, 'on_change'), 0);
}
add_action('delete_post', array(&$this, 'on_post_edit'), 0);
if ($this->_config->get_string('pgcache.engine') == 'file_generic') {
add_action('wp_logout', array(&$this, 'on_logout'), 0);
add_action('wp_login', array(&$this, 'on_login'), 0);
}
add_filter('wp_redirect', array(&$this, 'on_redirect_cleanup'), 0, 1);
add_action('sns_actions_executed', array(&$this, 'flush_post_cleanup'), 0);
if ($this->_config->get_boolean('pgcache.prime.post.enabled', false)) {
add_action('publish_post', array(&$this, 'prime_post'), 30);
}
if ($this->_config->get_boolean('pgcache.late_init') && !is_admin()) {
add_action('init', array($this, 'delayed_cache_print'), 99999);
}
}
开发者ID:rongandat,项目名称:sallumeh,代码行数:45,代码来源:PgCache.php
示例10: run
public function run()
{
$this->_config = w3_instance('W3_Config');
$this->_config_admin = w3_instance('W3_ConfigAdmin');
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php');
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin_ui.php');
$this->_page = w3tc_get_current_page();
if (is_network_admin() || !w3_is_multisite()) {
$this->edge_notification();
}
if (is_w3tc_admin_page()) {
add_action('admin_head', array($this, 'admin_head'));
add_action('w3tc_hide_button_custom-edge_mode', array($this, 'hide_edge_mode_notification'));
$support_reminder = $this->_config->get_boolean('notes.support_us') && $this->_config_admin->get_integer('common.install') < time() - W3TC_SUPPORT_US_TIMEOUT && $this->_config->get_string('common.support') == '' && !$this->_config->get_boolean('common.tweeted');
if ($support_reminder || w3tc_show_notification('support_us_popup')) {
add_action('w3tc-dashboard-head', array($this, 'support_us_nag'));
}
add_action('w3tc-dashboard-head', array($this, 'edge_nag'));
}
}
开发者ID:yszar,项目名称:linuxwp,代码行数:20,代码来源:NotificationsAdmin.php
示例11: admin_init
/**
* Setups actions
*/
public function admin_init()
{
if (current_user_can('manage_options')) {
/**
* @var W3_ConfigCompatibility $config_comp
*/
$config_comp = w3_instance('W3_ConfigCompatibility');
if ($config_comp->get_old_version() && isset($_GET['page'])) {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php');
if (is_w3tc_admin_page() || isset($GLOBALS['pagenow']) && 'plugins.php' === $GLOBALS['pagenow']) {
if (!w3_is_multisite() || !w3_force_master()) {
add_action('admin_notices', array($this, 'admin_notices'));
} else {
add_action('network_admin_notices', array($this, 'admin_notices'));
}
}
$config_comp->setup_settings();
}
}
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:23,代码来源:DefaultSettings.php
示例12: run
/**
* Called on plugin instantiation
*/
function run()
{
add_filter('w3tc_compatibility_test', array($this, 'verify_compatibility'));
if (is_admin()) {
add_action('wp_ajax_admin_w3tc_verify_newrelic_api_key', array($this, 'verify_newrelic_api_key'));
add_action('wp_ajax_w3tc_verify_newrelic_api_key', array($this, 'verify_newrelic_api_key'));
add_action('wp_ajax_admin_w3tc_get_newrelic_applications', array($this, 'get_newrelic_applications'));
add_action('wp_ajax_w3tc_get_newrelic_applications', array($this, 'get_newrelic_applications'));
$new_relic_enabled = $this->_config->get_boolean('newrelic.enabled');
if ($new_relic_enabled) {
global $pagenow;
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$page = W3_Request::get_string('page');
if ($pagenow == 'plugins.php' || strpos($page, 'w3tc_') !== false) {
if (!w3_is_multisite() || w3_is_multisite() && !$this->_config->get_boolean('common.force_master')) {
add_action('admin_notices', array($this, 'admin_notices'));
} else {
add_action('network_admin_notices', array($this, 'admin_notices'));
}
}
}
}
}
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:26,代码来源:NewRelicAdmin.php
示例13: get_groups
/**
* Returns minify groups
*
* @param string $theme
* @param string $template
* @param string $type
* @return array
*/
function get_groups($theme, $template, $type)
{
$result = array();
switch ($type) {
case 'css':
$groups = $this->_config->get_array('minify.css.groups');
break;
case 'js':
$groups = $this->_config->get_array('minify.js.groups');
break;
default:
return $result;
}
if (isset($groups[$theme]['default'])) {
$locations = (array) $groups[$theme]['default'];
} else {
$locations = array();
}
if ($template != 'default' && isset($groups[$theme][$template])) {
$locations = array_merge_recursive($locations, (array) $groups[$theme][$template]);
}
foreach ($locations as $location => $config) {
if (!empty($config['files'])) {
foreach ((array) $config['files'] as $file) {
$file = w3_normalize_file_minify2($file);
if (w3_is_url($file)) {
$precached_file = $this->_precache_file($file, $type);
if ($precached_file) {
$result[$location][$file] = $precached_file;
} else {
$this->error(sprintf('Unable to cache remote file: "%s"', $file));
}
} else {
if (!w3_is_multisite() && strpos(trailingslashit(WP_CONTENT_DIR), trailingslashit(w3_get_site_root())) !== false) {
$file = ltrim(w3_get_site_path(), '/') . str_replace(ltrim(w3_get_site_path(), '/'), '', $file);
}
$path = w3_get_document_root() . '/' . $file;
if (file_exists($path)) {
$result[$location][$file] = '//' . $file;
} else {
$this->error(sprintf('File "%s" doesn\'t exist', $path));
}
}
}
}
}
return $result;
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:56,代码来源:Minify.php
示例14: w3_force_master
/**
* @return bool
*/
function w3_force_master()
{
global $w3_force_master;
if (!is_null($w3_force_master)) {
return $w3_force_master;
}
if (!w3_is_multisite()) {
$w3_force_master = false;
} else {
$blog_data = w3_blogmap_get_blog_data();
if (is_null($blog_data) || $blog_data[0] != 'm' && $blog_data[0] != 'c') {
$w3_force_master = true;
} else {
$w3_force_master = $blog_data[0] == 'm';
}
}
return $w3_force_master;
}
开发者ID:Creative-Srijon,项目名称:top10bestwp,代码行数:21,代码来源:define.php
示例15: on_change_profile
/**
* Flush cache when user profile is updated
* @param int $user_id
*/
function on_change_profile($user_id)
{
static $flushed = false;
if (!$flushed) {
if (w3_is_multisite()) {
$blogs = get_blogs_of_user($user_id, true);
if ($blogs) {
global $w3_multisite_blogs;
$w3_multisite_blogs = $blogs;
}
}
$flush = w3_instance('W3_CacheFlush');
$flush->objectcache_flush();
$flushed = true;
}
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:20,代码来源:ObjectCache.php
示例16: w3_is_network
/**
* Returns if there is multisite mode
*
* @return boolean
*/
function w3_is_network()
{
return w3_is_wpmu() || w3_is_multisite();
}
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:9,代码来源:define.php
示例17: _e
?>
disabled="disabled"<?php
}
?>
/> <?php
_e('Optimize disk enhanced page and minify disk caching for <acronym title="Network File System">NFS</acronym>', 'w3-total-cache');
?>
</label>
<br /><span class="description"><?php
_e('Try this option if your hosting environment uses a network based file system for a possible performance improvement.', 'w3-total-cache');
?>
</span>
</th>
</tr>
<?php
if (is_network_admin() || !w3_is_multisite()) {
?>
<tr id="edge_mode">
<th colspan="2">
<?php
if (!w3tc_edge_mode()) {
echo '<a href="' . w3_admin_url('admin.php?page=' . $this->_page . '&w3tc_edge_mode_enable') . '"><strong>' . __('Enable Edge mode', 'w3-total-cache') . '</strong></a>';
} else {
echo '<a href="' . w3_admin_url('admin.php?page=' . $this->_page . '&w3tc_edge_mode_disable') . '"><strong>' . __('Disable Edge mode', 'w3-total-cache') . '</strong></a>';
}
?>
<br /><span class="description"><?php
_e('Enable this to try out new functionality under development. Might cause issues on some sites. If you have issues and can\'t access wp-admin, remove "define(\'W3TC_EDGE_MODE\', true);" from your wp-config.php file and edge mode features will be disabled.', 'w3-total-cache');
?>
</span>
</th>
开发者ID:easinewe,项目名称:Avec2016,代码行数:31,代码来源:general.php
示例18: set_newrelic_appname
/**
* Sets New Relic appname for an application if current state meets requirements.
*
* @param W3_Config $config
* @return boolean If appname was set or not
*/
public function set_newrelic_appname($config)
{
if ($config->get_boolean('newrelic.enabled') && !$config->get_boolean('late_init.enabled')) {
if (w3_is_multisite() && $config->get_boolean('common.force_master')) {
return false;
}
/**
* @var W3_Plugin_NewRelic $nr
*/
$nr = w3_instance('W3_Plugin_NewRelic');
$nr->set_appname();
return true;
}
return false;
}
开发者ID:Supreme007,项目名称:bestilblomster,代码行数:21,代码来源:Dispatcher.php
示例19: get_files_custom
/**
* Exports custom files to CDN
*
* @return array
*/
function get_files_custom()
{
$files = array();
$document_root = w3_get_document_root();
$custom_files = $this->_config->get_array('cdn.custom.files');
$custom_files = array_map('w3_parse_path', $custom_files);
$site_root = w3_get_site_root();
$path = w3_get_site_path();
if (strstr(WP_CONTENT_DIR, w3_get_site_root()) === false) {
$site_root = w3_get_document_root();
$path = '';
}
$content_path = trim(substr(WP_CONTENT_DIR, strlen($site_root)), '/\\');
$wp_content_folder = basename(WP_CONTENT_DIR);
foreach ($custom_files as $custom_file) {
if ($custom_file != '') {
$custom_file = w3_normalize_file($custom_file);
if (!w3_is_multisite()) {
$dir = trim(dirname($path . $custom_file), '/\\');
$rel_path = trim(dirname($custom_file), '/\\');
} else {
$rel_path = $dir = trim(dirname($custom_file), '/\\');
}
if (strpos($dir, '<currentblog>') != false) {
$rel_path = $dir = str_replace('<currentblog>', 'blogs.dir/' . w3_get_blog_id(), $dir);
}
if ($content_path && $content_path != $wp_content_folder) {
$dir = str_replace($wp_content_folder, $content_path, $dir);
$rel_path = str_replace($wp_content_folder, $content_path, $rel_path);
}
if ($dir == '.') {
$rel_path = $dir = '';
}
$mask = basename($custom_file);
$files = array_merge($files, $this->search_files($document_root . '/' . $dir, $rel_path, $mask));
}
}
return $files;
}
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:44,代码来源:Cdn.php
示例20: options
//.........这里部分代码省略.........
/**
* 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'));
}
/**
* 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>.', 'w3-total-cache'), $upload_path);
}
if (!w3_is_multisite()) {
$this->_errors[] = sprintf(__('The uploads path found in the database (%s) is inconsistent with the actual path. Please manually adjust the upload path either in miscellaneous settings or if not using a custom path %s automatically to resolve the issue.', 'w3-total-cache'), $upload_path, w3_button_link(__('update the path', 'w3-total-cache'), wp_nonce_url(sprintf('admin.php?page=%s&w3tc_config_update_upload_path', $this->_page), 'w3tc')));
}
}
/**
* Check CDN settings
*/
$cdn_engine = $this->_config->get_string('cdn.engine');
$error = '';
switch (true) {
case $cdn_engine == 'ftp' && !count($this->_config->get_array('cdn.ftp.domain')):
$this->_errors[] = __('A configuration issue prevents <acronym title="Content Delivery Network">CDN</acronym> from working:
The <strong>"Replace default hostname with"</strong>
field cannot be empty. Enter <acronym
title="Content Delivery Network">CDN</acronym>
provider hostname <a href="?page=w3tc_cdn#configuration">here</a>.
<em>(This is the hostname used in order to view objects
in a browser.)</em>', 'w3-total-cache');
break;
case $cdn_engine == 's3' && ($this->_config->get_string('cdn.s3.key') == '' || $this->_config->get_string('cdn.s3.secret') == '' || $this->_config->get_string('cdn.s3.bucket') == ''):
$error = __('The <strong>"Access key", "Secret key" and "Bucket"</strong> fields cannot be empty.', 'w3-total-cache');
break;
case $cdn_engine == 'cf' && ($this->_config->get_string('cdn.cf.key') == '' || $this->_config->get_string('cdn.cf.secret') == '' || $this->_config->get_string('cdn.cf.bucket') == '' || $this->_config->get_string('cdn.cf.id') == '' && !count($this->_config->get_array('cdn.cf.cname'))):
$error = __('The <strong>"Access key", "Secret key", "Bucket" and "Replace default hostname with"</strong> fields cannot be empty.', 'w3-total-cache');
break;
case $cdn_engine == 'cf2' && ($this->_config->get_string('cdn.cf2.key') == '' || $this->_config->get_string('cdn.cf2.secret') == '' || $this->_config->get_string('cdn.cf2.id') == '' && !count($this->_config->get_array('cdn.cf2.cname'))):
$error = __('The <strong>"Access key", "Secret key" and "Replace default hostname with"</strong> fields cannot be empty.', 'w3-total-cache');
break;
case $cdn_engine == 'rscf' && ($this->_config->get_string('cdn.rscf.user') == '' || $this->_config->get_string('cdn.rscf.key') == '' || $this->_config->get_string('cdn.rscf.container') == '' || !count($this->_config->get_array('cdn.rscf.cname'))):
$error = __('The <strong>"Username", "API key", "Container" and "Replace default hostname with"</strong> fields cannot be empty.', 'w3-total-cache');
break;
case $cdn_engine == 'azure' && ($this->_config->get_string('cdn.azure.user') == '' || $this->_config->get_string('cdn.azure.key') == '' || $this->_config->get_string('cdn.azure.container') == ''):
$error = __('The <strong>"Account name", "Account key" and "Container"</strong> fields cannot be empty.', 'w3-total-cache');
开发者ID:easinewe,项目名称:Avec2016,代码行数:67,代码来源:PluginView.php
注:本文中的w3_is_multisite函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论