PHP code example of ping-qu / aliyuncdn

1. Go to this page and download the library: Download ping-qu/aliyuncdn 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/ */

    

ping-qu / aliyuncdn example snippets


// 时区设置
date_default_timezone_set('UTC');
// 实例化客户端
$client = new eddy\AliYunCDNClient('key', 'secret');
// 发送请求
$response = $client->RefreshObjectCaches(['ObjectPath' => 'url']);
if ($response !== false) {
    // http 请求返回内容
    echo $response->getBody();
    // http 响应状态码
    echo $response->getStatusCode();
}