library/Rediska/Command/Rename.php
public function create($oldKey, $newKey, $overwrite = true)
    {
        $oldKeyConnection = $this->_rediska->getConnectionByKeyName($oldKey);
        $newKeyConnection = $this->_rediska->getConnectionByKeyName($newKey);

        $command = '';
        if ($oldKeyConnection === $newKeyConnection) {
            if ($overwrite) {
                $command = array();
            } else {
                $command = "";
            }
            $command = array($overwrite ? 'RENAME' : 'RENAMENX',
                             $this->_rediska->getOption('namespace') . $oldKey,
                             $this->_rediska->getOption('namespace') . $newKey);
        } else {
            $this->setAtomic(false);

            $command = array('GET',
                             $this->_rediska->getOption('namespace') . $oldKey);
        }

        return new Rediska_Connection_Exec($oldKeyConnection, $command);
    }
public function create($oldKey, $newKey, $overwrite = true)
    {
        $oldKeyConnection = $this->_rediska->getConnectionByKeyName($oldKey);
        $newKeyConnection = $this->_rediska->getConnectionByKeyName($newKey);

        $command = '';
        if ($oldKeyConnection === $newKeyConnection) {
            if ($overwrite) {
                $command = array();
            } else {
                $command = "";
            }
            $command = array($overwrite ? 'RENAME' : 'RENAMENX',
                             $this->_rediska->getOption('namespace') . $oldKey,
                             $this->_rediska->getOption('namespace') . $newKey);
        } else {
            $this->setAtomic(false);

            $command = array('GET',
                             $this->_rediska->getOption('namespace') . $oldKey);
        }

        return new Rediska_Connection_Exec($oldKeyConnection, $command);
    }
Create command

@param string            $oldKey    Old key name
@param string            $newKey    New key name
@param boolean[optional] $overwrite Overwrite the new name key if it already exists. For default is false.
@return Rediska_Connection_Exec