Deployment\SshServer::renameFile PHP Method

renameFile() public method

Renames and rewrites file on FTP server.
public renameFile ( $old, $new ) : void
return void
    public function renameFile($old, $new)
    {
        if (file_exists($path = "ssh2.sftp://{$this->sftp}{$new}")) {
            $perms = fileperms($path);
            $this->removeFile($new);
        }
        $this->protect('ssh2_sftp_rename', [$this->sftp, $old, $new]);
        if (!empty($perms)) {
            $this->protect('ssh2_sftp_chmod', [$this->sftp, $new, $perms]);
        }
    }