weboptic/flysystem-bunnycdn
Composer 安装命令:
composer require weboptic/flysystem-bunnycdn
包简介
Flysystem adapter for BunnyCDN
README 文档
README
Flysystem Adapter for BunnyCDN Storage
⚠️ Note – Breaking Change
⚠️ (21/Feb/22) As the upstream BunnyCDNStorage client has gone sometime without an update, it's become unsustainable to continue to use. For all updates, simply change the
BunnyCDNStoragetoBunnyCDNClientand re-import. ⚠️
Installation
To install flysystem-bunnycdn, require the package with no version constraint. This should match the flysystem-bunnycdn version with your version of FlySystem (v1, v2, v3 etc).
composer require platformcommunity/flysystem-bunnycdn "*"
Usage
use BunnyCDN\Storage\BunnyCDNClient; use League\Flysystem\Filesystem; use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNAdapter; use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion; $adapter = new BunnyCDNAdapter( new BunnyCDNClient( 'storage-zone', 'api-key', BunnyCDNRegion::FALKENSTEIN ) ); $filesystem = new Filesystem($adapter);
Usage with Pull Zones
To have BunnyCDN adapter publish to a public CDN location, you have to a "Pull Zone" connected to your BunnyCDN Storage Zone. Add the full URL prefix of your Pull Zone (including http:///https://) to the BunnyCDNAdapter parameter like shown below.
use BunnyCDN\Storage\BunnyCDNClient; use League\Flysystem\Filesystem; use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNAdapter; use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion; $adapter = new BunnyCDNAdapter( new BunnyCDNClient( 'storage-zone', 'api-key', BunnyCDNRegion::FALKENSTEIN ), 'https://testing.b-cdn.net/' # Pull Zone URL ); $filesystem = new Filesystem($adapter);
Note: You can also use your own domain name if it's configured in the pull zone.
Once you add your pull zone, you can use the ->getUrl($path), or in Laravel, the ->url($path) command to get the fully qualified public URL of your BunnyCDN assets.
Usage in Laravel 9
For a guide on how to use flysystem-bunnycdn in Laravel 9, follow the guide here:
https://blog.sinn.io/bunny-net-php-flysystem-v3/#usage-in-laravel-9
Regions
For a full region list, please visit the BunnyCDN API documentation page.
flysystem-bunnycdn also comes with constants for each region located within PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion.
List of Regions
BunnyCDNRegion::FALKENSTEIN = 'de'; BunnyCDNRegion::NEW_YORK = 'ny'; BunnyCDNRegion::LOS_ANGELAS = 'la'; BunnyCDNRegion::SINGAPORE = 'sg'; BunnyCDNRegion::SYDNEY = 'syd'; BuunyCDNRegion::UNITED_KINGDOM = 'uk';
Contributing
Pull requests welcome. Please feel free to lodge any issues as discussion points.
Licence
The Flysystem adapter for Bunny.net is licensed under MIT.
weboptic/flysystem-bunnycdn 适用场景与选型建议
weboptic/flysystem-bunnycdn 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 40 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 weboptic/flysystem-bunnycdn 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 weboptic/flysystem-bunnycdn 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 40
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-15