wemxo/filer-bundle
最新稳定版本:v1.0.1
Composer 安装命令:
composer require wemxo/filer-bundle
包简介
Useful symfony bundle to manage file storage.
README 文档
README
The filer bundle is a symfony bundle that allow you to manage files storage.
Usage
1- Configuration
# /config/packages/filer.yaml
filer:
types:
profile_picture:
folder: profile_picture
access: public
mime_types: [image/jpeg, image/png]
max_size: 5000000
filters: [thumbnail]
apply_watermarK: true
keep_source: false
source: thumbnail
document:
folder: document
access: public
mime_types: [text/plain]
max_size: 5000000
filters: ~
apply_watermarK: false
keep_source: true
source: null
accesses:
private: 'private_filesystem'
public: 'public_filesystem'
private_filesystemandpublic_filesystemshould be services alias ofGaufrette\FilesystemInterface.thumbnailmust be a defined filter inliip_imaginefilter_setsconfiguration.
2- Example
<?php
namespace App;
use Wemxo/FilerBundle/FilerInput;
classe MyService {
public function __construct(private FilerInterface $filer)
{
}
public function testEncryptPassword(string $text): string
{
$filerInput = new FilerInput(
'test.txt',
'Hello world !',
'text/plain',
120,
'document'
);
$output = $this->filer->saveFile($input);
}
}
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-30