onnov / elfinder-flysystem-driver
elFinder 的 Flysystem 驱动程序
Requires
- php: ^7.4|^8.0
- intervention/image: ^2.0
- league/flysystem: ^2|^3
- studio-42/elfinder: ^2.1.60
Requires (Dev)
- league/flysystem-memory: ^3
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: ^3.5
Suggests
- league/glide: 1.x to display images through Glide
This package is auto-updated.
Last update: 2024-09-19 08:55:22 UTC
README
& 修复上传 URL !
elFinder Flysystem 驱动程序
此包为 elFinder 添加了 VolumeDriver,以便在您的系统中使用 Flysystem 作为根。您需要安装 elFinder 2.1。您可以从中下载源代码或夜间版本:https://github.com/Studio-42/elFinder 或使用 Laravel 版本:https://github.com/barryvdh/laravel-elfinder
在您的 composer.json 中要求此包并更新 composer。
composer require barryvdh/elfinder-flysystem-driver
这需要 Flysystem,但您可能需要额外的适配器以满足您的需求。更多信息请参阅 https://github.com/thephpleague/flysystem。
基本用法
您可以通过将连接器配置设置为 Flysystem 来使用此驱动程序。
'roots' => [
[
'driver' => 'Flysystem',
'path' => 'images',
'URL' => '/images',
'filesystem' => new Filesystem(new LocalAdapter('/path/to/public_html')),
'cache' => 'session', // 'session', 'memory' or false
],
[
'driver' => 'Flysystem',
'URL' => 'http://mydomain.com/content',
'alias' => 'Mydomain.com',
'filesystem' => new Filesystem(new FtpAdapter(
[
'host' => 'mydomain.com',
'username' => 'user',
'password' => '****',
'root' => '/domains/mydomain.com/public_html/content',
]
)),
],
[
'driver' => 'Flysystem',
'adapter' => new DropboxAdapter(new Dropbox\Client($token, $appName))
],
];
path 和 URL 选项是可选的。path 默认为 '/', URL 仅在文件通过 URL 可见时才可能。
通过 Glide 显示缩略图/图像
如果您需要 Glide,您可以为您的图像显示缩略图并生成安全的 URL。
[
'driver' => 'Flysystem',
'filesystem' => $fs,
'glideURL' => 'http://domain.com/glideserver',
'glideKey' => 'your-sign-key',
],
您仍然可以使用来自 配置选项 的 tmbSize 和 tmbCrop 选项。
这将要求您设置一个基本的带有 Glide 的服务器,请参阅 http://glide.thephpleague.com/。signKey 是可选的,但可以帮助保护您的图像免受参数更改的影响。
注意:当保护图像时,您需要从您的请求对象中删除
_
参数:$request->query->remove('_');
否则签名将失败。_ 参数用于禁用缓存。
许可证
此 elFinder 驱动程序是开源软件,受 MIT 许可证 许可。