slims / object-storage
v1.0.0
2024-06-20 06:11 UTC
Requires
- aws/aws-sdk-php: ^3.306
README
这是SLiMS\Filesystems
的一个子库,以插件的形式存在,用于在采用插件的方式存储SLiMS上传的文件到采用对象存储架构和S3协议的存储服务器上。
警告
目前仅支持SLiMS的develop
分支,对于仍在使用SLiMS 9.6.1版本且尚未升级到develop
分支的用户(所有风险自行承担)。
适配器
默认适配器用于与以下存储服务器通信:
详细说明
Biznet Gio Object Storage
在此服务中,您可以通过将此repo克隆到插件文件夹中来使用此子库。
通过composer
composer require slims/object-storage
通过克隆
cd plugins/ git clone https://github.com/goslims/object-storage cd slims-object-storage composer install mkdir config/
在系统模块的子菜单插件中启动此插件,通过关键词storage
搜索。在之前创建的config
目录中创建磁盘配置。
nano config/disks.php
在上面的配置文件中,请将以下脚本的内容填入:
<?php return [ 'repository' => [ 'provider' => \SLiMS\ObjectStorage\Gio::class, 'options' => [ [ 'version' => 'latest', 'region' => '<Region>', 'endpoint' => '<S3 Endpoint>', 'use_path_style_endpoint' => true, 'credentials' => [ 'key' => '<key>', 'secret' => '<secret>' ], ], [ 'bucket' => '<bucket>' ] ] ] ];
您可以替换所有以<
开头以>
结尾的内容。订购信息可以通过这里访问。
如果想要添加其他存储,可以按照以下方式编写:
<?php return [ 'repository' => [ 'provider' => \SLiMS\ObjectStorage\Gio::class, 'options' => [ [ 'version' => 'latest', 'region' => '<Region>', 'endpoint' => '<S3 Endpoint>', 'use_path_style_endpoint' => true, 'credentials' => [ 'key' => '<key>', 'secret' => '<secret>' ], ], [ 'bucket' => '<bucket>' ] ] ], 'backup' => [ 'provider' => \SLiMS\ObjectStorage\Gio::class, 'options' => [ [ 'version' => 'latest', 'region' => '<Region>', 'endpoint' => '<S3 Endpoint>', 'use_path_style_endpoint' => true, 'credentials' => [ 'key' => '<key>', 'secret' => '<secret>' ], ], [ 'bucket' => '<bucket>' ] ] ] // dst ];
使用说明请参阅这里