https://github.com/windhoney/yii2-acm-kms
yii2-acm-kms
https://github.com/windhoney/yii2-acm-kms
Last synced: 3 months ago
JSON representation
yii2-acm-kms
- Host: GitHub
- URL: https://github.com/windhoney/yii2-acm-kms
- Owner: windhoney
- License: mit
- Created: 2020-08-31T09:34:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-01T09:55:43.000Z (over 4 years ago)
- Last Synced: 2025-01-15T17:24:29.337Z (4 months ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 配置参数(params-local)
```php
'ali_cloud' => [
'access_key' => [
'access_key_id' => 'xh*********O',
'access_key_secret' => 'jE************3',
],
'acm_key_list' => ['acm_bi_db'],
'acm_bi_db' => [
'namespace' => '40b************1b',
'app_name' => 'app**',
'data_id' => 'cipher-db***',
'group' => 'group**',
'is_encrypt' => 1,//1KMS加密2不加密
'end_point' => 'acm.aliyun.com',
'port' => '8080',
'kms_region_id' => 'cn-shanghai',
'kms_host' => 'kms.cn-shanghai.aliyuncs.com',
]
]
```
### 获取更新
```php
$ali_helper = new AcmHelper($key_name);//$key_name=acm_bi_db
$result = $ali_helper->getConfig();
```
### 监听配置
若配置中心启用加密,$content为加密后的密文
```php
$ali_helper->listenConfig($content)
```