xxtime/flysystem-aliyun-oss
最新稳定版本:1.7.1
Composer 安装命令:
composer require xxtime/flysystem-aliyun-oss
包简介
AliYun OSS adapter for flysystem. Support PHP8. aliyuncs/oss-sdk-php ~2.6
README 文档
README
AliYun OSS Storage adapter for flysystem - a PHP filesystem abstraction.
Installation
composer require xxtime/flysystem-aliyun-oss
Logs
1.3.0
- some args name changed
- default region oss-cn-hangzhou
1.7.0
- support flysystem v3
- support oss-sdk-php 2.6
- support PHP8
Usage
use League\Flysystem\Filesystem; use Xxtime\Flysystem\Aliyun\OssAdapter; $aliyun = new OssAdapter([ 'accessId' => '<aliyun access id>', 'accessSecret' => '<aliyun access secret>', 'bucket' => '<bucket name>', 'endpoint' => '<endpoint address>', // 'timeout' => 3600, // 'connectTimeout' => 10, // 'isCName' => false, // 'token' => '', ]); $filesystem = new Filesystem($aliyun); // Write Files $filesystem->write('path/to/file.txt', 'contents'); // get RAW data from aliYun OSS $raw = $aliyun->supports->getFlashData(); // Write Use writeStream $stream = fopen('local/path/to/file.txt', 'r+'); $filesystem->writeStream('path/to/file.txt', $stream); // Update Files $filesystem->update('path/to/file.txt', 'new contents'); // Check if a file exists $exists = $filesystem->has('path/to/file.txt'); // Read Files $contents = $filesystem->read('path/to/file.txt'); // Delete Files $filesystem->delete('path/to/file.txt'); // Rename Files $filesystem->rename('filename.txt', 'newname.txt'); // Copy Files $filesystem->copy('filename.txt', 'duplicate.txt'); // list the contents (not support recursive now) $filesystem->listContents('path', false);
// 说明:此方法返回从阿里云接口返回的原生数据,仅可调用一次 // DESC: this function return AliYun RAW data $raw = $aliyun->supports->getFlashData();
Document
Reference
http://flysystem.thephpleague.com/api/
https://github.com/thephpleague/flysystem
统计信息
- 总下载量: 488.48k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 54
- 点击次数: 1
- 依赖项目数: 31
- 推荐数: 6
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-06