slims/object-storage

安装: 3

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:senayan-plugin

v1.0.0 2024-06-20 06:11 UTC

This package is auto-updated.

Last update: 2024-09-20 06:44:50 UTC


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
];

使用说明请参阅这里