PHP code example of flash20 / yii2-qiniu

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

    

flash20 / yii2-qiniu example snippets


composer install
main.php

        'qiniu'=> [
            'class' => 'flash20\qiniu\Qiniu',
            'accessKey' => 'xxx',
            'secretKey' => 'xxx',
            'domain' => 'http://xxx',
            'bucket' => 'xxx',
        ],
code
Yii::$app->qiniu->uploadFile($file,time());