阿波罗配置中心插件

1.1 版本
2022-09-21 版本更新时间
126 安装
0 star

简介

阿波罗配置中心插件,自定义进程自动拉取配置

安装

composer require church/webman-apollo-plugin

使用

<?php
/**
 * 对象存储类
 * @author      church<wolfqong1993@gmail.com>
 * @since        1.0
 */

namespace support;

use OSS\OssClient;
use support\traits\SingleInstance;

class OSS
{
    use SingleInstance;

    public static function getInstance($new = false)
    {
        if (!self::$instance || $new) {
            $configuration = config('plugin.church.webman-apollo-plugin.oss.configurations');
            $accessKeyId = $configuration['accessKeyId'];
            $accessKeySecret = $configuration['accessKeySecret'];
            $endpoint = $configuration['endpoint'];

            self::$instance = new static(new OssClient($accessKeyId, $accessKeySecret, $endpoint));
        }

        return self::$instance;
    }
}

效果图(可选)

赞助商