leeroy/sail-fs3
Composer 安装命令:
composer require leeroy/sail-fs3
包简介
S3 Filesystem Adapter for SailCMS
README 文档
README
This is the official S3 Filesystem adapter for SailCMS. This adapter is module that you will be able to load and it will make the 's3://' protocol available to you.
Installing
php sail install:official leeroy/sail-fs3
This will install the package using composer and then update your composer file to autoload the package.
If you wish to install it manually, you and perform the following
composer require leeroy/sail-fs3
After that, you can add Leeroy\\FS3 to the modules section of the sailcms property of your composer.json file. It should look something like this:
"sailcms": { "containers": ["Spec"], "modules": [ "Leeroy\\FS3" ], "search": {} }
Configuration
When installed, you need to add the following to your .env file.
FS3_API_KEY=aws_key
FS3_API_SECRET=aws_secret
FS3_REGION=aws_region
FS3_BUCKET=bucket_name
FS3_ACL=public
Using
When you want to upload something, you can do something like this:
$fs = Filesytem::manager(); $fs->write('s3://file/path.jpg', $data, ['visibility' => 'public']);
If you want your file to be accessible by unsigned urls, you need to pass the visibility option and set it to public.
For the assets in SailCMS, set the adapter to s3 in your config/general.php in the assets section. SailCMS
automatically sets the file to public visibility.
You can now enjoy the S3 on your site.
leeroy/sail-fs3 适用场景与选型建议
leeroy/sail-fs3 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 237 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 leeroy/sail-fs3 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 leeroy/sail-fs3 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 237
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-10