kalitics / ged-bundle
文件管理
v4.0.5
2021-11-23 16:26 UTC
Requires
- php: ^7.1.3
- doctrine/collections: ^1.5
- doctrine/orm: ^2.7
- knplabs/knp-gaufrette-bundle: ^0.7.1
- sensio/framework-extra-bundle: ^5.0 || ^6.0
- symfony/asset: ^4.4 || ^5.0
- symfony/config: ^4.4 || ^5.0
- symfony/console: ^4.4 || ^5.0
- symfony/dependency-injection: ^4.4 || ^5.0
- symfony/doctrine-bridge: ^4.4 || ^5.0
- symfony/form: ^4.4 || ^5.0
- symfony/framework-bundle: ^4.4 || ^5.0
- symfony/http-foundation: ^4.4 || ^5.0
- symfony/http-kernel: ^4.4 || ^5.0
- symfony/options-resolver: ^4.4 || ^5.0
- twig/twig: ^2.4 || ^3.0
Requires (Dev)
- roave/security-advisories: dev-latest
- dev-master
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- dev-fix/ctp-ged
- dev-feature/ged-base-erp
- dev-fix/document-type-attribut-color
- dev-feature/#ged-sintec
- dev-feature/gallery-image
- dev-develop
- dev-legacy
This package is auto-updated.
Last update: 2024-09-23 22:29:06 UTC
README
为 Symfony 应用程序提供文件管理
安装
使用以下方式安装包:
composer require kalitics/ged-bundle
创建一个文件 config/packages/kalitics_ged.yaml,内容如下:
kalitics_ged:
path: "/"
创建一个新的文件 config/routes/kalitics_ged.yaml
_kalitics_ged:
resource: '@GedBundle/Resources/config/routes.xml'
prefix: /kalitics/kaliticsged/
配置
在创建一个拥有 GED 的实体时,使用服务 \Kalitics\GedBundle\Service\GedConfigurationService
在新实体上配置 GED。
$entity = $service->configureGed($entity);
为了正确配置,数据库需要一些信息,如分类和文档类型。GED 被配置为在表单中显示适当的分类。如果未配置,实体将显示所有文档类型在添加和更新表单中。将正确的分类链接到 gedOwnerEntity 非常重要,可以通过在数据库的 `ged_config_ged_category`
表中添加一些信息来实现。实体名称必须是 Namespace\EntityName
,分类的 id 是分类的 id。
用法
将实体标记为文件管理的所有者,在实体类中添加使用
use GedOwnerTrait;
在模板中渲染 GedController 以显示文件管理
{{ render(controller('kalitics_ged.controller.ged_controller:displayAction', {'entity': project})) }}
在配置中重命名
将 Ressources 重命名为 Resources
安装资产包
php bin/console assets:install
更改缩略图图像比例
你可以在 services.yaml 中添加以下内容来更改图像缩放比例
值越低,图像越亮,但也越像素化
ged_thumbnail_image_scale: 0.7
如果没有参数,默认值为 0.5
为 gaufrette 包添加配置
```yaml
knp_gaufrette:
adapters:
ged_thumbnails:
local:
directory: "%kernel.project_dir%/public/bundles/kaliticsged/images/thumbnail"
create: true
filesystems:
ged_thumbnails_fs:
adapter: ged_thumbnails
alias: ged_thumbs_fs
```
### Imagick required
If you don't have imagick already:
Create a ```script.sh```, then add (script for php7.3):
```shell
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install imagemagick pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.3.tgz
tar xvzf imagick-3.4.3.tgz
cd imagick-3.4.3
#install php7.3-dev to use phpize
apt-get install php7.3-dev -y
#compile extension
phpize
./configure
make install
#Delete folder after compilation
rm -rf /tmp/imagick-3.4.3*
#Add to php.ini and restart to apply change
echo extension=imagick.so >> /etc/php/7.3/cli/php.ini
service apache2 restart
```
then run your script ```sudo bash script.sh```