PHP code example of aprsoft / yii2-aliyun-oss

1. Go to this page and download the library: Download aprsoft/yii2-aliyun-oss 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/ */

    

aprsoft / yii2-aliyun-oss example snippets


'aliyunOssImage' => [
    "class" => 'AprSoft\Aliyun\OSS\Image',
    "accessKeyId" => 'xxxxxxxxxxxxxx',
    "accessKeySecret" => 'xxxxxxxx',
    "bucket" => 'xxxxx',
    "endpoint" => 'http://oss-cn-zhangjiakou.aliyuncs.com',
],
'aliyunOssBucket' => [
    "class" => 'AprSoft\Aliyun\OSS\Bucket',
    "accessKeyId" => 'xxxxxxx',
    "accessKeySecret" => 'xxxxxx',
    "endpoint" => 'http://oss-cn-zhangjiakou.aliyuncs.com',
],

$bucket = Yii::$app->aliyunOssImage;
$back = $bucket->list();