%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/mu-plugins/gd-system-plugin/includes/cli/
Upload File :
Create Path :
Current File : /dom645759/wp-content/mu-plugins/gd-system-plugin/includes/cli/class-cache.php

<?php

namespace WPaaS\CLI;

use \WP_CLI;
use \WP_CLI_Command;
use \WPaaS\Hosting_API;
use \WPaaS\Plugin;

if ( ! defined( 'ABSPATH' ) ) {

	exit;

}

final class Cache extends WP_CLI_Command {

	/**
	 * Flush the cache.
	 *
	 * ## OPTIONS
	 *
	 * [<type>...]
	 * : One or more cache types to flush. Accepted values: varnish, object,
	 * transient, cdn. All cache types will be flushed by default.
	 *

	 */
	public function flush( array $args, array $assoc_args ) {

		$allowed = [ 'transient', 'object', 'varnish', 'cdn' ];

		foreach ( array_diff( $args, $allowed ) as $type ) {

			WP_CLI::error( sprintf( '`%s` is not a supported cache type.', $type ), false );

		}

		$args = empty( $args ) ? $allowed : $args;

		foreach ( $allowed as $type ) {

			// Making sure we flush in the right sequence
			if ( ! in_array( $type, $args, true ) ) {

				continue;

			}

			switch ( $type ) {

				case 'transient':
					$transient = $this->flush_transient_cache( $assoc_args );
					break;
				case 'object':
					$object = $this->flush_object_cache();
					break;
				case 'varnish':
					$varnish = $this->flush_varnish_cache();
					break;
				case 'cdn':
					$cdn = $this->flush_cdn_cache();
					break;

			}
		}

		if ( ! empty( $varnish ) || ! empty( $object ) || ! empty( $transient ) || ! empty( $cdn ) ) {
			update_option( 'gd_system_last_cache_flush', time() );
		}

	}

	/**
	 * Date of the last cache flush.
	 *
	 * ## OPTIONS
	 *
	 * [--format=<format>]
	 * : PHP date format. Default: c
	 *
	 * @alias      last-flushed
	 *
	 * @subcommand last-flush
	 */
	public function last_flush( array $args, array $assoc_args ) {

		$format = WP_CLI\Utils\get_flag_value( $assoc_args, 'format', 'c' );
		$date   = Plugin::last_cache_flush_date( $format );

		if ( ! $date ) {

			WP_CLI::warning( 'The last cache flush date is unknown.' );

			return;

		}

		WP_CLI::line( Plugin::last_cache_flush_date( $format ) );

	}

	/**
	 * Flush the Varnish/Nginx cache.
	 *
	 *
	 * @return bool
	 */
	private function flush_varnish_cache() {

		$GLOBALS['wpaas_cache_class']->do_ban();

		WP_CLI::success( 'The Varnish page cache was flushed.' );

		return true;
	}

	/**
	 * Flush the object cache.
	 *
	 * @return bool
	 */
	private function flush_object_cache() {

		wp_cache_flush();

		WP_CLI::success( 'The object cache was flushed.' );

		return true;
	}

	/**
	 * Flush the transient cache.
	 *
	 * @param array $assoc_args (optional)
	 *
	 * @return bool
	 */
	private function flush_transient_cache( array $assoc_args = [] ) {

		$result = $GLOBALS['wpaas_cache_class']->flush_transients();

		if ( false === $result ) {

			WP_CLI::error( 'The transient cache could not be flushed.', false );

			return false;

		}

		WP_CLI::success( sprintf( '%d transients deleted from the database.', $result ) );

		return true;

	}

	/**
	 * Flush the CDN cache.
	 *
	 * Local-only once the platform owns the CDN half: the control plane reaches this
	 * command by running it inside the alloc and purges the CDN itself afterwards, so
	 * requesting a purge from here would issue a second one for every console flush.
	 *
	 * @return bool
	 */
	private function flush_cdn_cache() {

		if ( Hosting_API::is_available() ) {

			WP_CLI::success( 'The cdn cache is flushed by the platform.' );

			return true;

		}

		$GLOBALS['wpaas_cache_class']->flush_cdn();

		WP_CLI::success( 'The cdn cache was flushed.' );

		return true;

	}

}

Zerion Mini Shell 1.0
Jefferson County Republican Party – Local Republican Party
Home2026-11-20T19:47:34+00:00

Jefferson County
Republican Party

Jefferson County Republican Party

The Jefferson County Republican Party is committed to advancing limited government, lower taxes, less spending and individual liberty. Our goals are to grow the Republican Party by reaching new voters, advancing our platform grounded in conservative principles, and keeping Kentucky prosperous and free.

Limited Government

Lower Taxes

Public Safety

Individual Liberty

Join The JCRP Email List

Receive monthly newsletters about events, election updates, and volunteer opportunities.

ENSURING LIBERTY

Republican Party

Republicans throughout Kentucky come from all walks of life and from every area of our Commonwealth. Republicans are unified by the concept of the primacy of the individual and by an opposition to large, intrusive government. In every county and community in Kentucky, the individual is the heart and soul of our party.

Recent Media

new high for representation in jefferson county

Louisville GOP Marching Toward Nov., 2026 Election

Go to Top