官方下载 sdk包 到 extend目录下
代码如下
Loader::import('aliyun_openapi.aliyun-php-sdk-core.Config', EXTEND_PATH);
$iClientProfile = \DefaultProfile::getProfile("cn-hangzhou", "you ak", "you sk");
$client = new \DefaultAcsClient($iClientProfile);
$request = new Alidns\AddDomainRecordRequest();
$request->setMethod("GET");
$request->setDomainName('luvcx.site');
$request->setRR('test');
$request->setType('A');
$request->setValue('116.196.125.67');
$request->setTTL('600');
$request->setLine('default');
$response = $client->getAcsResponse($request);
$result = json_decode($response,true);
if(!empty($result['RecordId']))
{
//解析成功
}
else
{
//解析失败
}
来源:CSDN
作者:通信狗_汪汪
链接:https://blog.csdn.net/qq_34415586/article/details/83142166