Download the PHP package larva/flysystem-tos without Composer
On this page you can find all versions of the php package larva/flysystem-tos. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download larva/flysystem-tos
More information about larva/flysystem-tos
Files in larva/flysystem-tos
Download larva/flysystem-tos
More information about larva/flysystem-tos
Files in larva/flysystem-tos
Vendor larva
Package flysystem-tos
Short Description Flysystem adapter for the volc engine TOS storage.
License MIT
Package flysystem-tos
Short Description Flysystem adapter for the volc engine TOS storage.
License MIT
Please rate this library. Is it a good library?
Informations about the package flysystem-tos
flysystem-tos
这是火山引擎 TOS(Tinder Object Storage)对象存储的 Flysystem 适配器,支持 Flysystem v2/v3。
环境要求
- PHP >= 8.0
- Composer 2.0+
- Flysystem v2 或 v3
- 火山引擎 TOS PHP SDK v2.1+
安装
基础用法
1. 创建 TOS 客户端
2. 创建适配器
3. 配合 Filesystem 使用
可见性控制
适配器通过 VisibilityConverter 接口将 Flysystem 的可见性(public / private)映射为 TOS 的 ACL:
| Flysystem 可见性 | TOS ACL |
|---|---|
Visibility::PUBLIC |
public-read |
Visibility::PRIVATE |
private |
默认使用 PortableVisibilityConverter,你也可以实现 VisibilityConverter 接口自定义映射逻辑:
支持的方法
| 方法 | 说明 |
|---|---|
write($path, $contents, $config) |
写入文件 |
writeStream($path, $stream, $config) |
以流的方式写入文件 |
read($path) |
读取文件内容 |
readStream($path) |
以流的方式读取文件 |
fileExists($path) |
判断文件是否存在 |
directoryExists($path) |
判断目录是否存在 |
delete($path) |
删除文件 |
deleteDirectory($path) |
删除目录 |
createDirectory($path, $config) |
创建目录 |
setVisibility($path, $visibility) |
设置文件可见性 |
visibility($path) |
获取文件可见性 |
mimeType($path) |
获取文件 MIME 类型 |
lastModified($path) |
获取文件最后修改时间 |
fileSize($path) |
获取文件大小 |
listContents($path, $deep) |
列出目录内容 |
move($source, $destination, $config) |
移动文件 |
copy($source, $destination, $config) |
复制文件 |
Laravel 集成
在 Laravel 项目中,可以通过自定义 Filesystem 驱动的方式集成:
在 config/filesystems.php 中添加磁盘配置:
然后在 .env 中配置相应的环境变量:
使用方式:
获取客户端
如需直接操作 TOS SDK,可以获取底层客户端:
贡献
欢迎提交 Issue 和 Pull Request。
License
MIT
All versions of flysystem-tos with dependencies
PHP Build Version
Package Version
Requires
league/flysystem Version
^2.0|^3.0
league/mime-type-detection Version ^1.0.0
volcengine/ve-tos-php-sdk Version ^2.1
league/mime-type-detection Version ^1.0.0
volcengine/ve-tos-php-sdk Version ^2.1
The package larva/flysystem-tos contains the following files
Loading the files please wait ...