flysystem README

The project's README from github.com/thephpleague/flysystem. As one markdown file: README.md.

League\Flysystem

Author Source Code Latest Version Software License Quality Assurance Total Downloads php 7.2+

About Flysystem

Flysystem is a file storage library for PHP. It provides one interface to interact with many types of filesystems. When you use Flysystem, you're not only protected from vendor lock-in, you'll also have a consistent experience for which ever storage is right for you.

Getting Started

Officially supported adapters

Third party Adapters

You can always create an adapter yourself.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Enjoy

Oh, and if you've come down this far, you might as well follow me on twitter.

flysystem (thephpleague/flysystem)

Searching Database…

13.6K ·GitHub
这是干什么的?Flysystem 是一个 PHP 文件存储库。它为多种文件系统(本地或远程)提供统一的操作接口,让你的代码不会绑定在单一存储服务商上。
它是我添加到代码里的库,还是需要部署的东西?它是一个库,不是服务:你的 PHP 代码在应用程序内部直接调用它。它没有界面,没有服务器,也没有任何可以单独运行的东西。
怎么把它加到我的项目里?用 Composer 包的方式安装(composer require league/flysystem),然后针对你的存储方式选择对应的适配器(比如本地磁盘、S3 或 FTP)创建一个 Flysystem 实例,再通过它的 API 操作文件。
除了 PHP 之外还需要什么?只需要 PHP 和 Composer;这个库本身不需要数据库或外部服务。当然,云存储的适配器需要相应服务的凭据。
它能对接哪些存储后端?官方适配器覆盖本地磁盘、FTP、SFTP、内存、AWS S3、AsyncAws S3、Google Cloud Storage、MongoDB GridFS、WebDAV 和 Zip 压缩包。社区适配器还提供 Azure Blob、Dropbox、Google Drive、OneDrive 等更多选择。
以后想换存储方式难不难?这正是这套抽象的意义:基于 Flysystem 统一接口写的代码,在更换适配器时(比如从本地磁盘换成 S3)依然能正常工作。
它能应对不稳定的后端或缓存问题吗?可以,辅助适配器包括 RetryAdapter、FallbackAdapter、LogAdapter 和 ReadWriteAdapter,此外还有元数据缓存(Metadata Cache)和延迟迁移(Migration)适配器。
我能把 zip 压缩包当成文件系统来用吗?可以,ZipArchive 在官方支持的适配器列表里,所以 zip 文件可以通过同一套接口当作存储后端来使用。
Size
3.9 MB
Stars
13.6K
Age
12y
Commits · 90 Days