src/Oss/OssAdapter.php
public function rename($path, $newpath)
    {
        try {
            /**
             * 如果是一个资源，请保持最后不是以“/”结尾！
             *
             */
            $path = rtrim($this->mergePath($path), '/');

            $this->getOss()->copyObject($this->bucket, $path, $this->bucket, rtrim($this->mergePath($newpath), '/'), []);
            $this->delete($path);
            return true;
        }catch (OssException $e){

        }
        return false;
    }
public function rename($path, $newpath)
    {
        try {
            /**
             * 如果是一个资源，请保持最后不是以“/”结尾！
             *
             */
            $path = rtrim($this->mergePath($path), '/');

            $this->getOss()->copyObject($this->bucket, $path, $this->bucket, rtrim($this->mergePath($newpath), '/'), []);
            $this->delete($path);
            return true;
        }catch (OssException $e){

        }
        return false;
    }
重命名文件

@param $oldname
@param $newname
@return boolean
@author yangyifan <yangyifanphp@gmail.com>