403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.127
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/ia/wp-content/plugins/wordpress-popular-posts/src/Container/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/ia/wp-content/plugins/wordpress-popular-posts/src/Container/Container.php
<?php
/**
 * A Simple Dependency Injector Container (DIC).
 *
 * Largely based on Carl Alexander's Dependency Injection Container.
 * @link https://carlalexander.ca/dependency-injection-wordpress/
 */

namespace WordPressPopularPosts\Container;

class Container implements \ArrayAccess
{
    /**
     * Values stored inside the container.
     *
     * @var array
     */
    private $values;

    /**
     * Constructor.
     *
     * @param array $values
     */
    public function __construct(array $values = [])
    {
        $this->values = $values;
    }

    /**
     * Configure the container using the given container configuration objects.
     *
     * @param array $configurations
     */
    public function configure(array $configurations)
    {
        foreach ($configurations as $configuration) {
            if ( $configuration instanceof ContainerConfigurationInterface ) {
                $configuration->modify($this);
            }
        }
    }

    /**
     * Checks if there's a value in the container for the given key.
     *
     * @param mixed $key
     *
     * @return bool
     */
    public function offsetExists($key) : bool /** @TODO: starting PHP 8.0 $key can be declared as mixed $key, see https://www.php.net/manual/en/language.types.declarations.php */
    {
        return array_key_exists($key, $this->values);
    }

    /**
     * Sets a value inside of the container.
     *
     * @param mixed $key
     * @param mixed $value
     */
    public function offsetSet($key, $value) : void /** @TODO: starting PHP 8.0 $key and $value can be declared as mixed $key, mixed $value */
    {
        $this->values[$key] = $value;
    }

    /**
     * Unset the value in the container for the given key.
     *
     * @param mixed $key
     */
    public function offsetUnset($key) : void /** @TODO: starting PHP 8.0 $key can be declared as mixed $key */
    {
        unset($this->values[$key]);
    }

    /**
     * Get a value from the container.
     *
     * @param mixed $key
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($key) /** @TODO: starting PHP 8.0 $key can be declared as mixed $key */
    {
        if ( ! $this->offsetExists($key) ) {
            throw new \InvalidArgumentException(sprintf('Container doesn\'t have a value stored for the "%s" key.', esc_html($key)));
        }
        return $this->values[$key] instanceof \Closure ? $this->values[$key]($this) : $this->values[$key];
    }

    /**
     * Creates a closure used for creating a service using the given callable.
     *
     * @param \Closure $closure
     *
     * @return \Closure
     */
    public function service(\Closure $closure)
    {
        return function(Container $container) use ($closure) {
            static $object;

            if ( null === $object ) {
                $object = $closure($container);
            }

            return $object;
        };
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit