403Webshell
Server IP : 192.64.118.117  /  Your IP : 18.222.25.32
Web Server : LiteSpeed
System : Linux premium56.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64
User : thecgapy ( 1160)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/thecgapy/tcrgfinancesuite.com/wp-content/plugins/w3-total-cache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/thecgapy/tcrgfinancesuite.com/wp-content/plugins/w3-total-cache/Extensions_Util.php
<?php
namespace W3TC;

class Extensions_Util {
	/**
	 * Get registered extensions
	 *
	 * @param unknown $config
	 * @return array
	 */
	static public function get_extensions( $config ) {
		return apply_filters( "w3tc_extensions", __return_empty_array(), $config );
	}

	/**
	 * Get registered extension
	 *
	 * @param unknown $extension
	 * @param unknown $config
	 * @return array
	 */
	static public function get_extension( $config, $extension ) {
		$exts = self::get_extensions( $config );
		if ( !isset( $exts[$extension] ) )
			return null;

		return $exts[$extension];
	}

	/**
	 * Returns the inactive extensions
	 *
	 * @param unknown $config
	 * @return array
	 */
	static public function get_inactive_extensions( $config ) {
		$extensions = Extensions_Util::get_extensions( $config );
		$config = Dispatcher::config();
		$active_extensions = $config->get_array( 'extensions.active' );
		return array_diff_key( $extensions, $active_extensions );
	}

	/**
	 * Returns the active extensions
	 *
	 * @param unknown $config
	 * @return array
	 */
	static public function get_active_extensions( $config ) {
		$extensions = Extensions_Util::get_extensions( $config );
		$extensions_keys = array_keys( $extensions );
		$config = Dispatcher::config();
		$active_extensions = $config->get_array( 'extensions.active' );
		return array_intersect_key( $extensions, $active_extensions );
	}

	/**
	 *
	 *
	 * @param unknown $extension
	 * @param Config  $w3_config
	 * @return bool
	 */
	static public function activate_extension( $extension, $w3_config ) {
		$all_extensions = Extensions_Util::get_extensions( $w3_config );
		$extensions = $w3_config->get_array( 'extensions.active' );

		if ( !$w3_config->is_extension_active( $extension ) ) {
			$meta = $all_extensions[$extension];

			$filename = W3TC_EXTENSION_DIR . '/' . trim( $meta['path'], '/' );
			if ( !file_exists( $filename ) )
				return false;

			include $filename;

			$extensions[$extension] = $meta['path'];
			ksort( $extensions, SORT_STRING );
			$w3_config->set( 'extensions.active', $extensions );

			// if extensions doesnt want to control frontend activity -
			// activate it there too
			if ( !isset( $meta['active_frontend_own_control'] ) ||
				!$meta['active_frontend_own_control'] ) {
				$w3_config->set_extension_active_frontend( $extension, true );
			}

			try {
				$w3_config->save();
				return true;
			} catch ( \Exception $ex ) {
			}
		}

		return false;
	}


	/**
	 *
	 *
	 * @param unknown $extension
	 * @param Config  $config
	 * @param bool    $dont_save_config
	 * @return bool
	 */
	static public function deactivate_extension( $extension, $config, $dont_save_config = false ) {
		$extensions = $config->get_array( 'extensions.active' );
		if ( array_key_exists( $extension, $extensions ) ) {
			unset( $extensions[$extension] );
			ksort( $extensions, SORT_STRING );
			$config->set( 'extensions.active', $extensions );
		}

		$config->set_extension_active_frontend( $extension, false );

		try {
			if ( !$dont_save_config )
				$config->save();
			do_action( "w3tc_deactivate_extension_{$extension}" );
			return true;
		} catch ( \Exception $ex ) {}

		return false;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit