jimchen/aliyun-acm

阿里云ACM PHP SDK

v1.0.2 2020-05-17 09:38 UTC

This package is auto-updated.

Last update: 2024-09-24 14:06:29 UTC


README

阿里云ACM PHP SDK.

安装

$ composer require jimchen/aliyun-acm -vvv

使用

use Aliyun\Acm\Client;

$client = new Client('acm.aliyun.com');
$client->setAccessKey('your access key');
$client->setSecretKey('your secret key');
$client->setNameSpace('your namespace');
$client->setNameSpace('your namespace');
$client->setAppName('your app name');

/** 
 * 在进行下面操作前必须调用获取服务器IP列表 refreshAcmServerIpList()
 * @see https://help.aliyun.com/document_detail/64129.html?spm=a2c4g.11186623.6.574.bef5674fio1Bnv 
 */
$client->refreshAcmServerIpList();

/**
 * 获取配置
 * @see https://help.aliyun.com/document_detail/64131.html?spm=a2c4g.11186623.6.576.5305674fxujgIk
 * @var string $config 
 */
$config = $client->getConfig('your dataId', 'your group');
/**
 * 发布配置
 * @see https://help.aliyun.com/document_detail/69307.html?spm=a2c4g.11186623.6.578.2cf37a1c8vxBgD
 * @var bool $isPublish 
 */
$isPublish = $client->publish('your dataId', 'your group', '{"a":1}');
/** 
 * 删除配置
 * @see https://help.aliyun.com/document_detail/69308.html?spm=a2c4g.11186623.6.579.23e052b5igAgFi
 * @var bool $isRemove 
 */
$isRemove = $client->remove('your dataId', 'your group');
/** 
 * 检查配置是否更新,如果检测到更新会立即返回true,否则会进行长轮询等待30秒
 * @see https://help.aliyun.com/document_detail/64132.html?spm=a2c4g.11186623.6.577.5b9111b6a3vgi8
 * @var bool $isModify 
 */
$isModify = $client->checkIfModify('your dataId', 'your group', '{"a":1}');

贡献

您可以通过以下三种方式之一进行贡献

  1. 使用问题跟踪器提交错误报告。
  2. 问题跟踪器上回答问题或修复错误。
  3. 贡献新功能或更新wiki。

代码贡献过程并不十分正式。您只需确保遵循PSR-0、PSR-1和PSR-2编码规范。任何新的代码贡献都必须附有相应的单元测试(如果适用)。

许可证

MIT