fgits/flysystem-fallback-to-read-only-adapter
Composer 安装命令:
composer require fgits/flysystem-fallback-to-read-only-adapter
包简介
Flystem adapter with a fallback to a read-only flystem adapter
README 文档
README
Description
Need to interact with files without altering the originals? Our dual-adapter system ensures safe access to data while allowing modifications in a controlled manner. This system is designed to help manage non-private data in a development environment while seamlessly integrating with production data.
Read-Only Adapter Functions:
- Read
- List
Write-Only Adapter Capabilities:
- Complete flexibility in actions, with restrictions defined only by the adapter's capabilities.
Note: It's essential to understand that this adapter doesn't transform a regular adapter into a read-only version. Instead, it restricts write or delete operations.
How it Works: When you're working with two adapters, Adapter A (standard) and Adapter B (read-only):
Reading: The system will first attempt to read from Adapter A. If the required data isn't located there, it will revert to Adapter B.
Writing: If the data doesn't exist on Adapter A, the system will first create a copy there. Then, any modifications will be made to Adapter A, ensuring that Adapter B remains unchanged.
Installation
composer require fgits/flysystem-fallback-to-read-only-adapter
Usage
$nonTouchableAdapter = new League\Flysystem\Adapter\AwsS3(...);
$doWhateverYouWantAdapter = new League\Flysystem\Adapter\Local(...);
$adapter = new Fgits\Flysystem\ReadOnlyFallback\ReadOnlyFallbackAdapter($doWhateverYouWantAdapter, $nonTouchableAdapter);
统计信息
- 总下载量: 5.74k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-07