403Webshell
Server IP : 87.229.120.60  /  Your IP : 216.73.216.86
Web Server : Apache
System : Linux outside 5.4.8_Algonet_ZeroMAC_0.9.4.8 #6 SMP Mon Feb 3 20:36:07 CET 2020 x86_64
User : server ( 1002)
PHP Version : 8.3.20
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/faktorteam/www/wp-content/plugins/wp-rocket/inc/Engine/Container/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/faktorteam/www/wp-content/plugins/wp-rocket/inc/Engine/Container//ReflectionContainer.php
<?php

namespace WP_Rocket\Engine\Container;

use WP_Rocket\Engine\Container\Argument\ArgumentResolverInterface;
use WP_Rocket\Engine\Container\Argument\ArgumentResolverTrait;
use WP_Rocket\Engine\Container\Exception\NotFoundException;
use ReflectionClass;
use ReflectionFunction;
use ReflectionMethod;

class ReflectionContainer implements
    ArgumentResolverInterface,
    ImmutableContainerInterface
{
    use ArgumentResolverTrait;
    use ImmutableContainerAwareTrait;

    /**
     * {@inheritdoc}
     */
    public function get($alias, array $args = [])
    {
        if (! $this->has($alias)) {
            throw new NotFoundException(
                sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $alias)
            );
        }

        $reflector = new ReflectionClass($alias);
        $construct = $reflector->getConstructor();

        if ($construct === null) {
            return new $alias;
        }

        return $reflector->newInstanceArgs(
            $this->reflectArguments($construct, $args)
        );
    }

    /**
     * {@inheritdoc}
     */
    public function has($alias)
    {
        return class_exists($alias);
    }

    /**
     * Invoke a callable via the container.
     *
     * @param  callable $callable
     * @param  array    $args
     * @return mixed
     */
    public function call(callable $callable, array $args = [])
    {
        if (is_string($callable) && strpos($callable, '::') !== false) {
            $callable = explode('::', $callable);
        }

        if (is_array($callable)) {
            if (is_string($callable[0])) {
                $callable[0] = $this->getContainer()->get($callable[0]);
            }

            $reflection = new ReflectionMethod($callable[0], $callable[1]);

            if ($reflection->isStatic()) {
                $callable[0] = null;
            }

            return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args));
        }

        if (is_object($callable)) {
            $reflection = new ReflectionMethod($callable, '__invoke');

            return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args));
        }

        $reflection = new ReflectionFunction($callable);

        return $reflection->invokeArgs($this->reflectArguments($reflection, $args));
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit