The set of Aliyun Cloud Service SDK ,Support for composer library.
- PHP 7.0+.
- CURL extension.
composer require axios/aliyun-sdk
- VOD -> Done
- CDN -> Done
- OSS -> Base on aliyun/aliyun-oss-php-sdk
- SMS -> base on flc/dysms
- MTS -> Done
- ECS -> in development
- APIGateway -> in development
- ......
- require composer autoload
require_once __DIR__. "/../vendor/autoload.php";
- auth
$access_id = "testAccessKeyId";
$access_secret = "testAccessKeySecret";
\aliyun\sdk\Aliyun::auth($access_id,$access_secret);
- Setting Region
\aliyun\sdk\Aliyun::region('cn-shanghai');
- Request
$response = \aliyun\sdk\vod\Vod::GetCategories()
->setCateId(-1)
->setPageNo(4)
->setPageSize(10)
->request();
// Or Request like this
$request = \aliyun\sdk\vod\Vod::GetCategories();
$request->setCateId(-1);
$request->setPageNo(4);
$request->setPageSize(10)
$response = $request->request();
- Get Response Content
dump($response->getContent());
use aliyun\sdk\vod\request\VodCommon;
class Example extends VodCommon {
public function doSomething(){
//setting Action
$this->setActionName("action_name");
//setting parameter
$this->setParam("param_name","param_value");
return $this->request();
}
}
licensed under the Apache License 2.0