src/Oss/OssAdapter.php
protected function recursiveDelete($path)
    {
        $file_list = $this->listContents(rtrim($path, '/'));
        //如果当前文件夹文件不为空,则直接去删除文件夹
        if ( is_array($file_list) && count($file_list) > 0 ) {
            foreach ($file_list as $file) {
                if ($file['path'] == $path) {
                    continue;
                }
                if ($file['file_type'] == self::FILE_TYPE_FILE) {
                    $this->delete($file['path']);
                } else {
                    $this->recursiveDelete($file['path']);
                }
            }
        }
        $this->getOss()->deleteObject($this->bucket, $path);
    }
protected function recursiveDelete($path)
    {
        $file_list = $this->listContents(rtrim($path, '/'));
        //如果当前文件夹文件不为空,则直接去删除文件夹
        if ( is_array($file_list) && count($file_list) > 0 ) {
            foreach ($file_list as $file) {
                if ($file['path'] == $path) {
                    continue;
                }
                if ($file['file_type'] == self::FILE_TYPE_FILE) {
                    $this->delete($file['path']);
                } else {
                    $this->recursiveDelete($file['path']);
                }
            }
        }
        $this->getOss()->deleteObject($this->bucket, $path);
    }
递归删除全部文件

@param $path
@author yangyifan <yangyifanphp@gmail.com>