Uname:Linux cp196.maytech.vn 5.14.0-687.66.2.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 6 16:20:31 EST 2026 x86_64

Base Dir : /home2/dlsafepha/public_html

User : dlsafepha


403WebShell
403Webshell
Server IP : 103.249.100.196  /  Your IP : 216.73.216.194
Web Server : Apache
System : Linux cp196.maytech.vn 5.14.0-687.66.2.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 6 16:20:31 EST 2026 x86_64
User : dlsafepha ( 1078)
PHP Version : 8.2.36
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home2/dlsafepha/www/wp-content/plugins/woocommerce/packages/email-editor/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/dlsafepha/www/wp-content/plugins/woocommerce/packages/email-editor/src/class-container.php
<?php
/**
 * This file is part of the MailPoet plugin.
 *
 * @package MailPoet\EmailEditor
 */

declare( strict_types = 1 );
namespace MailPoet\EmailEditor;

/**
 * Class Container is a simple dependency injection container.
 *
 * @package MailPoet\EmailEditor
 */
class Container {
	/**
	 * A list of registered services
	 *
	 * @var array $services
	 */
	protected array $services = array();

	/**
	 * A list of created instances
	 *
	 * @var array
	 */
	protected array $instances = array();

	/**
	 * The method for registering a new service
	 *
	 * @param string   $name    The name of the service.
	 * @param callable $callback The callable that will be used to create the service.
	 * @return void
	 */
	public function set( string $name, callable $callback ): void {
		$this->services[ $name ] = $callback;
	}

	/**
	 * Method for getting a registered service
	 *
	 * @template T
	 * @param class-string<T> $name The name of the service.
	 * @return T
	 * @throws \Exception If the service is not found.
	 */
	public function get( $name ) {
		// Check if the service is already instantiated.
		if ( isset( $this->instances[ $name ] ) ) {
			return $this->instances[ $name ];
		}

		// Check if the service is registered.
		if ( ! isset( $this->services[ $name ] ) ) {
			throw new \Exception( esc_html( "Service not found: $name" ) );
		}

		$this->instances[ $name ] = $this->services[ $name ]( $this );

		return $this->instances[ $name ];
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit