Credis_Client::renameCommand PHP Method

renameCommand() public method

1. renameCommand('foo') // Salted md5 hash for all commands -> md5('foo'.$command) 2. renameCommand(function($command){ return 'my'.$command; }); // Callable 3. renameCommand('get', 'foo') // Single command -> alias 4. renameCommand(['get' => 'foo', 'set' => 'bar']) // Full map of [command -> alias]
public renameCommand ( string | callable | array $command, string | null $alias = NULL )
$command string | callable | array
$alias string | null
    public function renameCommand($command, $alias = NULL)
    {
        if (!$this->standalone) {
            $this->forceStandalone();
        }
        if ($alias === NULL) {
            $this->renamedCommands = $command;
        } else {
            if (!$this->renamedCommands) {
                $this->renamedCommands = array();
            }
            $this->renamedCommands[$command] = $alias;
        }
        return $this;
    }