!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.3.27 

uname -a: Linux pdx1-shared-a4-04 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64 

uid=6659440(dh_z2jmpm) gid=2086089(pg10499364) groups=2086089(pg10499364)  

Safe-mode: OFF (not secure)

/usr/local/wp/vendor/behat/behat/src/Behat/Behat/Context/   drwxr-xr-x
Free 712.08 GB of 879.6 GB (80.96%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ContextFactory.php (4.04 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Behat.
 * (c) Konstantin Kudryashov <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Behat\Behat\Context;

use Behat\Testwork\Argument\Validator;
use Behat\Behat\Context\Argument\ArgumentResolver;
use Behat\Behat\Context\Initializer\ContextInitializer;
use Behat\Testwork\Argument\ArgumentOrganiser;
use ReflectionClass;

/**
 * Instantiates contexts using registered argument resolvers and context initializers.
 *
 * @author Konstantin Kudryashov <[email protected]>
 */
final class ContextFactory
{
    /**
     * @var ArgumentOrganiser
     */
    private $argumentOrganiser;
    /**
     * @var ArgumentResolver[]
     */
    private $argumentResolvers = array();
    /**
     * @var ContextInitializer[]
     */
    private $contextInitializers = array();
    /**
     * @var Validator
     */
    private $validator;

    /**
     * Initialises factory.
     *
     * @param ArgumentOrganiser $argumentOrganiser
     */
    public function __construct(ArgumentOrganiser $argumentOrganiser)
    {
        $this->argumentOrganiser = $argumentOrganiser;
        $this->validator = new Validator();
    }

    /**
     * Registers context argument resolver.
     *
     * @param ArgumentResolver $resolver
     */
    public function registerArgumentResolver(ArgumentResolver $resolver)
    {
        $this->argumentResolvers[] = $resolver;
    }

    /**
     * Registers context initializer.
     *
     * @param ContextInitializer $initializer
     */
    public function registerContextInitializer(ContextInitializer $initializer)
    {
        $this->contextInitializers[] = $initializer;
    }

    /**
     * Creates and initializes context class.
     *
     * @param string             $class
     * @param array              $arguments
     * @param ArgumentResolver[] $singleUseResolvers
     *
     * @return Context
     */
    public function createContext($class, array $arguments = array(), array $singleUseResolvers = array())
    {
        $reflection = new ReflectionClass($class);
        $resolvers = array_merge($singleUseResolvers, $this->argumentResolvers);
        $resolvedArguments = $this->resolveArguments($reflection, $arguments, $resolvers);
        $context = $this->createInstance($reflection, $resolvedArguments);
        $this->initializeInstance($context);

        return $context;
    }

    /**
     * Resolves arguments for a specific class using registered argument resolvers.
     *
     * @param ReflectionClass    $reflection
     * @param array              $arguments
     * @param ArgumentResolver[] $resolvers
     *
     * @return mixed[]
     */
    private function resolveArguments(ReflectionClass $reflection, array $arguments, array $resolvers)
    {
        $newArguments = $arguments;

        foreach ($resolvers as $resolver) {
            $newArguments = $resolver->resolveArguments($reflection, $newArguments);
        }

        if (!$reflection->hasMethod('__construct')) {
            return $newArguments;
        }

        $constructor = $reflection->getConstructor();
        $newArguments = $this->argumentOrganiser->organiseArguments($constructor, $newArguments);
        $this->validator->validateArguments($constructor, $newArguments);

        return $newArguments;
    }

    /**
     * Creates context instance.
     *
     * @param ReflectionClass $reflection
     * @param array           $arguments
     *
     * @return mixed
     */
    private function createInstance(ReflectionClass $reflection, array $arguments)
    {
        if (count($arguments)) {
            return $reflection->newInstanceArgs($arguments);
        }

        return $reflection->newInstance();
    }

    /**
     * Initializes context class and returns new context instance.
     *
     * @param Context $context
     */
    private function initializeInstance(Context $context)
    {
        foreach ($this->contextInitializers as $initializer) {
            $initializer->initializeContext($context);
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0796 ]--