jgivoni / flysystem-cache-adapter
一个符合PSR-6规范的Flysystem v3适配器装饰器,用于缓存文件元数据以提高性能。
3.2.3
2024-02-19 12:11 UTC
Requires
- php: ^8.1
- league/flysystem: ^3.0
- psr/cache: ^2.0|^3.0
Requires (Dev)
- ext-xdebug: *
- ext-zend-opcache: *
- league/flysystem-adapter-test-utilities: ^3.15
- league/flysystem-aws-s3-v3: ^3.15
- league/flysystem-memory: ^3.15
- mockery/mockery: ^1.6
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.3
- symfony/cache: ^6.3|^7.0
Suggests
- symfony/cache: Ready to use adapters for the most common caching backends
README
变更日志亮点
- 3.2.2
- 3.1.2
- 3.1
概述
这正是您所需的符合PSR-6规范的Flysystem v3缓存适配器!目标是透明地缓存文件元数据,从而在查找文件是否存在、检查大小或修改日期等操作中提高性能。它可以轻松配置以与内存缓存、Redis、Memcached、Doctrine或文件系统或其他来自Symfony的适配器一起工作。
这个库不是其他任何存储库的直接分支,而是从头开始编写的。我旨在保持其维护,但已将其视为成熟,且没有计划添加任何新功能。
为什么使用这个库?
它支持符合PSR-6规范的Flysystem v3,并且目前正处于维护状态,这使得它优于我找到的其他替代方案。
league/flysystem-cached-adapter
(仅支持Flysystem v1,该版本不再维护)lustmored/flysystem-v2-simple-cache-adapter
(自2022年1月以来似乎没有维护)
如果您对此有所疑问,第一个版本被称为版本3,以与对应的Flysystem版本相匹配。
安装
composer require jgivoni/flysystem-cache-adapter
示例用法
$cache = new \Symfony\Component\Cache\Adapter\RedisAdapter(...); $filesystemAdapter = new \League\Flysystem\AwsS3V3\AwsS3V3Adapter(...); $cachedFilesystemAdapter = new \jgivoni\Flysystem\Cache\CacheAdapter($filesystemAdapter, $cache);