https://github.com/fifsky/aliyun-acm
Aliyun ACM SDK for PHP
https://github.com/fifsky/aliyun-acm
acm aliyun php
Last synced: 5 months ago
JSON representation
Aliyun ACM SDK for PHP
- Host: GitHub
- URL: https://github.com/fifsky/aliyun-acm
- Owner: fifsky
- License: mit
- Created: 2018-07-03T14:18:11.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-13T05:37:42.000Z (almost 7 years ago)
- Last Synced: 2025-07-02T18:46:00.530Z (11 months ago)
- Topics: acm, aliyun, php
- Language: PHP
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aliyun-ACM SDK for PHP
Aliyun ACM SDK for PHP, Multi-ip polling and local file cache is supported
## Install
```
composer require fifsky/aliyun-acm
```
Or add a dependency to the composer.json
```
"require": {
"fifsky/aliyun-acm": "1.0.*"
}
```
Run
```
composer update
```
## Usage
```php
use Aliyun\ACM\Client;
$client = new Client([
"accessKey"=>"***********",
"secretKey"=>"***********",
"endPoint"=>"acm.aliyun.com",
"nameSpace"=>"***********",
"timeOut"=>30, //long pull timeout default 30s
]);
//get config
$ret = $client->getConfig("test","DEFAULT_GROUP");
print_r($ret);
//subscribe
$ret = $client->subscribe("test","DEFAULT_GROUP");
print_r($ret);
//pulish
$ret = $client->publish("test","DEFAULT_GROUP","config content");
print_r($ret);
//remove config
$ret = $client->delete("test","DEFAULT_GROUP");
print_r($ret);
//get all config by tenant
$ret = $client->getAllConfigs(1,1);
print_r($ret);
```
## Exception
If the API request fails, an throw exception is RequestException
```php
use Aliyun\ACM\RequestException;
try{
$ret = $client->getConfig("test","DEFAULT_GROUP");
print_r($ret);
}catch (RequestException $e){
print_r($e);
}
```
## License
The SDK is open-sourced software licensed under the MIT license.