403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : root ( 0)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/wp.5/wp-content/plugins/woocommerce-payments/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/wp.5/wp-content/plugins/woocommerce-payments/src/Container.php
<?php
/**
 * Class Container
 *
 * @package WooCommerce\Payments
 */

namespace WCPay;

use WCPay\Vendor\Psr\Container\ContainerInterface;
use WCPay\Vendor\League\Container\Exception\ContainerException;
use WCPay\Internal\DependencyManagement\ExtendedContainer;
use WCPay\Internal\DependencyManagement\ServiceProvider\PaymentsServiceProvider;
use WCPay\Internal\DependencyManagement\DelegateContainer\LegacyContainer;
use WCPay\Internal\DependencyManagement\DelegateContainer\WooContainer;
use WCPay\Internal\DependencyManagement\ServiceProvider\GenericServiceProvider;
use WCPay\Internal\DependencyManagement\ServiceProvider\ProxiesServiceProvider;

// @codeCoverageIgnoreStart

/**
 * Hides errors during update from 6.6.0 or 6.6.1 to 6.6.2.
 *
 * This class would be loaded without the right dependencies (and autoloader)
 * being loaded before it after the update is complete. When that happens,
 * the ContainerInterface would still be in a different namespace, and would not exist here.
 *
 * Preventing the class from being loaded here does nothing but hide the error.
 * All later requests will work properly.
 */
if (
	! interface_exists( ContainerInterface::class )
	&& isset( $_GET['action'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
	&& 'upload-plugin' === $_GET['action'] // phpcs:ignore WordPress.Security.NonceVerification.Recommended
	&& isset( $GLOBALS['pagenow'] )
	&& 'update.php' === $GLOBALS['pagenow']
) {
	wp_die();
}

// @codeCoverageIgnoreEnd

/**
 * WCPay Dependency Injection Container.
 *
 * Wraps the ExtendedContainer implementation to only allow public access to
 * certain methods of the internal container.
 *
 * The public methods of this class should be a subset of the ExtendedContainer
 * methods, and follow their signatures. Avoid adding other methods here.
 *
 * During tests, the internal ExtendedContainer is available through
 * the `wcpay_get_test_container()` method, allowing full manipulation.
 */
class Container implements ContainerInterface {
	/**
	 * Internal container instance.
	 *
	 * @var ExtendedContainer
	 */
	private $container;

	/**
	 * Initializes the container.
	 *
	 * Dependencies should not be provided during runtime,
	 * but are useful while testing the container.
	 *
	 * @param LegacyContainer $legacy_container Delegate container for classes in `includes` (Optional).
	 * @param WooContainer    $woo_container    Delegate container for WooCommerce (Optional).
	 */
	public function __construct(
		?LegacyContainer $legacy_container = null,
		?WooContainer $woo_container = null
	) {
		$this->container = new ExtendedContainer();

		// Allow the container to be used as a dependency.
		$this->container->addShared( static::class, $this );

		// Add shared services.
		$this->load_providers();

		// Allow delegating unresolved queries to classes from `includes`.
		$this->container->delegate( $legacy_container ?? new LegacyContainer() );

		// Allow delegating unresolved queries to the WooCommerce container.
		$this->container->delegate( $woo_container ?? new WooContainer() );
	}

	/**
	 * Retrieves an instance of a given class.
	 *
	 * @template ID
	 * @param class-string<ID> $id The ID of the class to retrieve.
	 * @return ID
	 * @throws ContainerException In case the ID could not be resolved or instantiated.
	 */
	public function get( $id ) {
		try {
			return $this->container->get( $id );
		} catch ( \Throwable $e ) {
			throw new ContainerException( $e->getMessage(), $e->getCode(), $e ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
		}
	}

	/**
	 * Checks if a class is available.
	 *
	 * @param string $id The ID of the class to check.
	 * @return bool
	 */
	public function has( $id ) {
		return $this->container->has( $id );
	}

	/**
	 * Loads all available providers into the container.
	 */
	private function load_providers() {
		$this->container->addServiceProvider( new GenericServiceProvider() );
		$this->container->addServiceProvider( new PaymentsServiceProvider() );
		$this->container->addServiceProvider( new ProxiesServiceProvider() );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit