jenko / flysystem-gaufrette
Gaufrette适配器用于Flysystem
v1.0.0
2017-01-26 15:27 UTC
Requires
- php: >=5.4.0
- knplabs/gaufrette: ^0.2
- league/flysystem: ^1.0
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is auto-updated.
Last update: 2024-08-29 04:31:04 UTC
README
安装
composer require jenko/flysystem-gaufrette
用法
基本用法
use Jenko\Flysystem\GaufretteAdapter; use Gaufrette\Adapter\Local; $adapter = new GaufretteAdapter( new Local(__DIR__ . '/path/to/files'); ); $filesystem = new Filesystem($adapter);
高级用法
use Jenko\Flysystem\GaufretteAdapter; use Gaufrette\Adapter\Local; use Gaufrette\Adapter\Flysystem; // Hadouken! $adapter = new GaufretteAdapter( new Flysystem( new GaufretteAdapter( new Flysystem( new GaufretteAdapter( new Flysystem( new GaufretteAdapter( new Local( __DIR__ . '/path/to/files' ) ) ) ) ) ) ) ); $filesystem = new Filesystem($adapter);
等等,这是什么?
Gaufrette增加了Flysystem适配器,因此回赠一下也是合情合理的。虽然感觉有点yo dawg,但很有用。例如,如果你有一个与flysystem API紧密耦合的代码库(遗留应用程序,显然你不会这么做),但希望切换到Gaufrette,这将允许你这样做,而无需修改代码库中的所有旧API调用。有关实际用法的更多信息,请参阅这篇博客文章:http://jenko.me/legacy/2017/03/07/from-gaufrette-to-flysystem-and-back-again/
它还允许你构建双向的、有趣的嵌套,如上述高级用法示例中所示。
不支持的函数
Flysystem有一些方法Gaufrette不完全支持,以下列出
- update
- updateStream
- copy
- createDir
- getVisibility
- setVisibility
以下方法仅支持实现了MetadataSupporter
的Gaufrette适配器
- getMetadata
以下方法仅支持实现了SizeCalculator
的Gaufrette适配器
- getSize
以下方法仅支持实现了MimeTypeProvider
的Gaufrette适配器
- getMimetype