![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/demo.intellicart.co/vendor/predis/predis/src/Command/ |
<?php /* * This file is part of the Predis package. * * (c) Daniele Alessandri <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Predis\Command; /** * Command factory for mainline Redis servers. * * This factory is intended to handle standard commands implemented by mainline * Redis servers. By default it maps a command ID to a specific command handler * class in the Predis\Command\Redis namespace but this can be overridden for * any command ID simply by defining a new command handler class implementing * Predis\Command\CommandInterface. * * @author Daniele Alessandri <[email protected]> */ class RedisFactory extends Factory { /** * */ public function __construct() { $this->commands = array( 'ECHO' => 'Predis\Command\Redis\ECHO_', 'EVAL' => 'Predis\Command\Redis\EVAL_', 'OBJECT' => 'Predis\Command\Redis\OBJECT_', ); } /** * {@inheritdoc} */ public function getCommandClass(string $commandID): ?string { $commandID = strtoupper($commandID); if (isset($this->commands[$commandID]) || array_key_exists($commandID, $this->commands)) { $commandClass = $this->commands[$commandID]; } elseif (class_exists($commandClass = "Predis\Command\Redis\\$commandID")) { $this->commands[$commandID] = $commandClass; } else { return null; } return $commandClass; } /** * {@inheritdoc} */ public function undefine(string $commandID): void { // NOTE: we explicitly associate `NULL` to the command ID in the map // instead of the parent's `unset()` because our subclass tries to load // a predefined class from the Predis\Command\Redis namespace when no // explicit mapping is defined, see RedisFactory::getCommandClass() for // details of the implementation of this mechanism. $this->commands[strtoupper($commandID)] = null; } }