Server IP : 172.67.158.161 / Your IP : 3.135.249.37 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/duplicator-pro/aws/Guzzle/Service/Command/Factory/ |
Upload File : |
<?php namespace DuplicatorPro\Guzzle\Service\Command\Factory; use DuplicatorPro\Guzzle\Inflection\InflectorInterface; use DuplicatorPro\Guzzle\Inflection\Inflector; use DuplicatorPro\Guzzle\Service\ClientInterface; /** * Command factory used to create commands referencing concrete command classes */ class ConcreteClassFactory implements FactoryInterface { /** @var ClientInterface */ protected $client; /** @var InflectorInterface */ protected $inflector; /** * @param ClientInterface $client Client that owns the commands * @param InflectorInterface $inflector Inflector used to resolve class names */ public function __construct(ClientInterface $client, InflectorInterface $inflector = null) { $this->client = $client; $this->inflector = $inflector ?: Inflector::getDefault(); } public function factory($name, array $args = array()) { // Determine the class to instantiate based on the namespace of the current client and the default directory $prefix = $this->client->getConfig('command.prefix'); if (!$prefix) { // The prefix can be specified in a factory method and is cached $prefix = implode('\\', array_slice(explode('\\', get_class($this->client)), 0, -1)) . '\\Command\\'; $this->client->getConfig()->set('command.prefix', $prefix); } $class = $prefix . str_replace(' ', '\\', ucwords(str_replace('.', ' ', $this->inflector->camel($name)))); // Create the concrete command if it exists if (class_exists($class)) { return new $class($args); } } }