alphasnow/aliyun-oss-flysystem
最新稳定版本:3.4.2
Composer 安装命令:
composer require alphasnow/aliyun-oss-flysystem
包简介
Flysystem adapter for the Aliyun storage
README 文档
README
💾 Flysystem Adapter for Aliyun Object Storage Service.
Compatibility
| flysystem | aliyun-oss-flysystem | readme |
|---|---|---|
| ^3.0 | ^3.0 | readme |
| ^2.0 | ^2.0 | readme |
| ^1.0 | ^1.0 | readme |
| ~1.0.0 | ^0.3 | readme |
Installation
composer require "alphasnow/aliyun-oss-flysystem"
Usage
Initialize
use OSS\OssClient; use AlphaSnow\Flysystem\Aliyun\AliyunFactory; $config = [ "access_key_id" => "**************", // Required, YourAccessKeyId "access_key_secret" => "********************", // Required, YourAccessKeySecret "endpoint" => "oss-cn-shanghai.aliyuncs.com", // Required, Endpoint "bucket" => "bucket-name", // Required, Bucket ]; $flysystem = (new AliyunFactory())->createFilesystem($config); $flysystem->write("file.md", "contents"); $flysystem->writeStream("foo.md", fopen("file.md", "r")); $fileExists = $flysystem->fileExists("foo.md"); $flysystem->copy("foo.md", "baz.md"); $flysystem->move("baz.md", "bar.md"); $flysystem->delete("bar.md"); $has = $flysystem->has("bar.md"); $read = $flysystem->read("file.md"); $readStream = $flysystem->readStream("file.md"); $flysystem->createDirectory("foo/"); $directoryExists = $flysystem->directoryExists("foo/"); $flysystem->deleteDirectory("foo/"); $listContents = $flysystem->listContents("/", true); $listPaths = []; foreach ($listContents as $listContent) { $listPaths[] = $listContent->path(); } $lastModified = $flysystem->lastModified("file.md"); $fileSize = $flysystem->fileSize("file.md"); $mimeType = $flysystem->mimeType("file.md"); $flysystem->setVisibility("file.md", "private"); $visibility = $flysystem->visibility("file.md");
Options
$flysystem->write("file.md", "contents", [ "options" => ["checkmd5" => false] ]); $flysystem->write("bar.md", "contents", [ "headers" => ["Content-Disposition" => "attachment;filename=bar.md"] ]); $flysystem->write("baz.md", "contents", [ "visibility" => "private" ]);
Reference
https://github.com/thephpleague/flysystem
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 225.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-09