php 请使用此repo:https://github.com/Pross/beaver-cache-helper此要点将不再更新。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 请使用此repo:https://github.com/Pross/beaver-cache-helper此要点将不再更新。相关的知识,希望对你有一定的参考价值。

<?php
/**
 * Plugin Name: Beaver Builder Cache Helper
 * Description: This plugin will clear various caches when layouts and templates are saved. It also clears the cache when WordPress finishes updating plugins and themes. The plugin also defines the DONOTCACHEPAGE constant when the builder is active, this is respected by most cache plugins.
 * Version: 1.0
 * License: GNU General Public License v2.0
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 */
class FL_Cache_Buster {

	public static function init() {
		add_action( 'upgrader_process_complete',           array( __class__, 'clear_caches' ) );
		add_action( 'fl_builder_after_save_layout',        array( __class__, 'clear_caches' ) );
		add_action( 'fl_builder_after_save_user_template', array( __class__, 'clear_caches' ) );
		add_action( 'template_redirect',                   array( __class__, 'donotcache' ) );
	}

	/**
	 * Clear the various cache plugins.
	 */
	public static function clear_caches() {

		//rocket cache
		if ( function_exists( 'rocket_clean_domain' ) ) {
			rocket_clean_domain();
		}

		// wp-super-cache
		if ( function_exists( 'wp_cache_clear_cache' ) ) {
			wp_cache_clear_cache();
		}

		// WPEngine
		if ( class_exists( 'WpeCommon' ) ) {
			WpeCommon::purge_memcached();
			WpeCommon::clear_maxcdn_cache();
			WpeCommon::purge_varnish_cache();
		}

		// w3 total crash
		if ( function_exists( 'w3tc_pgcache_flush' ) ) {
			w3tc_pgcache_flush();
		}

		// siteground
		if ( function_exists( 'sg_cachepress_purge_cache' ) ) {
			sg_cachepress_purge_cache();
		}
		error_log( 'Cleared Caches' );
	}

	/**
	 * Set DONOTCACHEPAGE if builder is active.
	 */
	public static function donotcache() {
		if ( ! defined( 'DONOTCACHEPAGE' )
			&& class_exists( 'FLBuilderModel' )
			&& FLBuilderModel::is_builder_active() ) {
				define( 'DONOTCACHEPAGE', true );
		}
	}

}
FL_Cache_Buster::init();

以上是关于php 请使用此repo:https://github.com/Pross/beaver-cache-helper此要点将不再更新。的主要内容,如果未能解决你的问题,请参考以下文章

pagehelper的使用

Redis入门

php.ini中文翻译版--转载

如何解决此错误您可能需要适当的加载程序来处理此文件类型

对http://repo1.maven.org/maven2/的请求返回501 HTTPS必需的状态和主体

安装php扩展redis (windows环境)