PHP code example of cloudmario / hehe-aliyun

1. Go to this page and download the library: Download cloudmario/hehe-aliyun library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cloudmario / hehe-aliyun example snippets


$c = new AliyunClient;
$c->accessKeyId = "<accessKeyId>";
$c->accessKeySecret = "<accessKeySecret>";
$c->serverUrl = "<serverUrl>";

//例如, 获取`云解析`的`records`
$req = new Dns20150109DescribeDomainRecordsRequest;
$req->setDomainName('hehe.com');
try {
	$resp = $c->execute($req);
	if ( $resp->DomainRecords ) {
		print_r($resp);
	} else {
		$code = $resp->Code;
		$message = $resp->Message;
		echo $code . " : " . $message;
	}
} catch (Exception $e) {
	print_r($e);
}