PHP code example of feehi / yii2-cdn

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

    

feehi / yii2-cdn example snippets


       

    'components' => [
        'cdn' => [
            'class' => feehi\cdn\QiniuTarget::className(),
            'accessKey' => 'xxxxxxx',
            'secretKey' => 'xxxxxxxxx',
            'bucket' => 'xxx',
            'host' => 'http://xxxx.xxx.com'
        ]
    ]

    'components' => [
        'cdn' => [
            'class' => feehi\cdn\AliossTarget::className(),
            'bucket' => 'xxx',
            'accessKey' => 'xxxx',
            'accessSecret' => 'xxxxxxx',
            'endPoint' => 'oss-cn-beijing.aliyuncs.com',
            'host' => 'http://xxxx.xxx.com'
        ]
    ]

    'components' => [
        'cdn' => [
            'class' => feehi\cdn\QcloudTarget::className(),
            'appId' => 'xxxxx',
            'secretId' => 'xxxxxx',
            'secretKey' => 'xxxxxxx',
            'region' => 'tj',
            'bucket' => 'xxx',
            'host' => 'http://image-1251086492.costj.myqcloud.com',
        ]
    ]

    'components' => [
        'cdn' => [
            class' => feehi\cdn\NeteaseTarget::className(),
            'accessKey' => 'xxxxx',
            'accessSecret' => 'xxxxxxx',
            'endPoint' => 'nos-eastchina1.126.net',
            'bucket' => 'xxx',
            'host' => 'http://xxxx.xxx.com'
        ]
    ]

    'components' => [
        'cdn' => [
            class' => feehi\cdn\DummyTarget::className(),
        ]
    ]