Rename Object

@param string $oldname Path From
@param string $newname Path To

@return bool
555001
public function rename($oldname, $newname)
    {
        $this->copy($oldname, $newname);

        // Delete the original object
        if ($this->isDir($oldname))
        {
            $this->deleteFolder($oldname);
        } else {
            $this->delete($oldname);
        }

        return true;
    }
1358464
public function renameCollection($newname) {

        if (!in_array($newname, $this->database->getCollectionNames())) {

            $this->database->connection->exec('ALTER TABLE '.$this->name.' RENAME TO '.$newname);

            $this->name = $newname;

            return true;
        }

        return false;
    }
511044
public function rename($new_name, $new_extension = false)
	{
		$info = pathinfo($this->path);

		$new_name = str_replace(array('..', '/', '\\'), array('', '', ''), $new_name);
		$extension = $new_extension === false
			? $info['extension']
			: ltrim($new_extension, '.');
		$extension = ! empty($extension) ? '.'.$extension : '';

		$new_path = $info['dirname'].DS.$new_name.$extension;

		$return =  $this->area->rename($this->path, $new_path);
		$return and $this->path = $new_path;

		return $return;
	}
1107996
public function rename($oldPath, $newPath)
    {
        $old = $this->at($oldPath);
        $new = $this->at($newPath);

        if (null === $old || (null !== $new && 'dir' === $new->type))
            return false;

        if ('file' === $old->type) {
            $this->at($newPath, $old);
        } else {
            if (! $this->mkdir($newPath, $old->perms)) {
                return false;
            }
            $oldPath = $this->realpath($oldPath) . '/';
            $newPath = $this->realpath($newPath) . '/';
            $length = strlen($oldPath);
            foreach (array_keys($this->files) as $childPath) {
                if (substr($childPath, 0, $length) === $oldPath) {
                    $newChildPath = $newPath . substr($childPath, $length);
                    $this->at($newChildPath, $this->at($childPath));
                    $this->at($childPath, null);
                }
            }
        }
        $this->at($oldPath, null);
        return true;
    }
1222591
public function rename($newpath)
    {
        if ($this->filesystem->rename($this->path, $newpath)) {
            $this->path = $newpath;

            return true;
        }

        return false;
    }
1270229
public function renameOnDFS( $oldPath, $newPath )
    {
        $oldPathHandler = $this->getHandler( $oldPath );
        $newPathHandler = $this->getHandler( $newPath );

        // same handler, normal rename
        if ( $oldPathHandler === $newPathHandler )
        {
            return $oldPathHandler->renameOnDFS( $oldPath, $newPath );
        }
        // different handlers, create on new, delete on old
        else
        {
            if ( $newPathHandler->createFileOnDFS( $newPath, $oldPathHandler->getContents( $oldPath ) ) !== true )
                return false;

            return $oldPathHandler->delete( $oldPath );
        }
    }
1232518
public function rename($oldName, $newName, $pathToFile = null)
    {
        if ($pathToFile==null) {
            $pathToFile=$this->_filePath;
        }
        if (file_exists($pathToFile."/".$oldName)) {
            $this->createDir($pathToFile);
            return rename($pathToFile."/".$oldName, $pathToFile."/".$newName);
        } else {
            return false;
        }
    }
203632
public function rename($key, $newkey) {
        $keys = [$key, $newkey];
        return $this->returnCommand(['RENAME'], $keys, $keys);
    }
714448
public function rename($path, $newpath)
    {
        list ($oldParent, $fileId) = $this->splitPath($path);
        list ($newParent, $newName) = $this->splitPath($newpath);

        $file = new Google_Service_Drive_DriveFile();
        $file->setName($newName);
        $opts = [
            'fields' => $this->fetchfieldsGet
        ];
        if ($newParent !== $oldParent) {
            $opts['addParents'] = $newParent;
            $opts['removeParents'] = $oldParent;
        }

        $updatedFile = $this->service->files->update($fileId, $file, $this->applyDefaultParams($opts, 'files.update'));

        if ($updatedFile) {
            $this->cacheFileObjects[$updatedFile->getId()] = $updatedFile;
            $this->cacheFileObjectsByName[$newParent . '/' . $newName] = $updatedFile;
            return true;
        }

        return false;
    }
1361149
public function renameTag($oldName, $newName) {
		return $this
			->begin()// http://stackoverflow.com/a/1873932
			// create new as alias to old (`git tag NEW OLD`)
			->run('git tag', $newName, $oldName)// delete old (`git tag -d OLD`)
			->removeTag($oldName)// WARN! removeTag() calls end() method!!!
			->end();
	}
725102
public function rename($oldName, $newName)
	{
		$form = $this->get($oldName);
		$this->delete($oldName);
		$this->add($newName, $form['code'], $form['title']);
	}
657310
public function rename($old_name, $new_name)
    {
        $old_name = $this->_getAbsoluteRemotePath($old_name);
        $new_name = $this->_getAbsoluteRemotePath($new_name);

        if (false === file_exists($old_name)) {
            return $this->_trigger_error(sprintf('Could not open remote file: %s.', $old_name));
        }

        if (true === file_exists($new_name)) {
            return $this->_trigger_error(sprintf('Remote file already exists: %s.', $new_name));
        }

        if (false === @rename($old_name, $new_name)) {
            return $this->_trigger_error(sprintf('Unable to rename %s to %s', $old_name, $new_name));
        }

        return true;
    }
1238959
public function renameColumn($old, $new)
    {
        $this->append(sprintf(' RENAME COLUMN %s TO %s ', $this->quote($old), $this->quote($new)));
        return $this;
    }
1115476
public function rename($index, $newName)
    {
        if (!isset($this->names[$index])) {
            return false;
        }
        if ($this->names[$index] === $newName) {
            return false;
        }
        $this->context->getMappings();
        $this->names[$index] = $newName;
        $this->indexes = array_flip($this->names);
        $this->onRename($index, $newName);
        return true;
    }
181468
public function rename(string $oldName, string $newName)
    {
        if (!@ftp_rename($this->ftp, $oldName, $newName)) {
            throw new Exception(sprintf("Cannot rename file from %s to %s", $oldName, $newName));
        }

        return $this;
    }
692511
public function rename(string $newName): bool {
		return $this->manager->rename($this->getUrl(), Paths::getPath($this->getAbsolutePath()) . "/" . $newName);
	}
746262
public function renameSequence($oldName, $newName)
    {
        if (!$this->hasSequence($oldName)) {
            throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasSequence($newName)) {
            throw SchemaException::schemaSequenceAlreadyExists($this->getName(), $newName);
        }

        $this->sequences[$oldName]->setName($newName);
        $this->sequences[$newName] = $this->sequences[$oldName];

        unset($this->sequences[$oldName]);
    }