Gogs 5 anos atrás
pai
commit
7de52678ab

+ 2 - 1
composer.json

@@ -30,7 +30,8 @@
         "vlucas/phpdotenv": "^4.0",
         "phpoption/phpoption": "^1.6@dev",
         "workerman/gatewayclient": "3.0.13",
-        "yiisoft/yii2-imagine": "*"
+        "yiisoft/yii2-imagine": "*",
+        "yiier/yii2-aliyun-oss": "*"
     },
     "require-dev": {
         "yiisoft/yii2-codeception": "~2.0.5",

+ 52 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "aeb48360e34e25ae510115ddb54c1dd1",
+    "content-hash": "6590d56417cf12e79315b8e0a428ca26",
     "packages": [
         {
             "name": "aliyuncs/oss-sdk-php",
@@ -1474,6 +1474,55 @@
             "homepage": "http://www.workerman.net",
             "time": "2018-09-15T03:03:50+00:00"
         },
+        {
+            "name": "yiier/yii2-aliyun-oss",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/yiier/yii2-aliyun-oss.git",
+                "reference": "ce1587cd58466cdf3a593f78532a210f2645f76a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/yiier/yii2-aliyun-oss/zipball/ce1587cd58466cdf3a593f78532a210f2645f76a",
+                "reference": "ce1587cd58466cdf3a593f78532a210f2645f76a",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "aliyuncs/oss-sdk-php": ">2.0",
+                "yiisoft/yii2": "*"
+            },
+            "type": "yii2-extension",
+            "autoload": {
+                "psr-4": {
+                    "yiier\\AliyunOSS\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "forecho",
+                    "email": "caizhenghai@gmail.com"
+                }
+            ],
+            "description": "Yii2 阿里云 OSS",
+            "keywords": [
+                "AliyunOSS",
+                "extension",
+                "oss",
+                "yii2"
+            ],
+            "time": "2020-06-08T06:35:54+00:00"
+        },
         {
             "name": "yiisoft/yii2",
             "version": "2.0.29",
@@ -2019,6 +2068,7 @@
                 "faker",
                 "fixtures"
             ],
+            "abandoned": true,
             "time": "2019-04-16T09:48:34+00:00"
         },
         {
@@ -2126,6 +2176,7 @@
                 "JOSE",
                 "base64url"
             ],
+            "abandoned": true,
             "time": "2017-02-12T22:14:17+00:00"
         },
         {

+ 1 - 0
vendor/composer/autoload_psr4.php

@@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
 $baseDir = dirname($vendorDir);
 
 return array(
+    'yiier\\AliyunOSS\\' => array($vendorDir . '/yiier/yii2-aliyun-oss'),
     'yii\\swiftmailer\\' => array($vendorDir . '/yiisoft/yii2-swiftmailer'),
     'yii\\redis\\' => array($vendorDir . '/yiisoft/yii2-redis'),
     'yii\\imagine\\' => array($vendorDir . '/yiisoft/yii2-imagine/src'),

+ 5 - 0
vendor/composer/autoload_static.php

@@ -21,6 +21,7 @@ class ComposerStaticInit1bf592390398b3f4608da27e3f630485
     public static $prefixLengthsPsr4 = array (
         'y' => 
         array (
+            'yiier\\AliyunOSS\\' => 16,
             'yii\\swiftmailer\\' => 16,
             'yii\\redis\\' => 10,
             'yii\\imagine\\' => 12,
@@ -99,6 +100,10 @@ class ComposerStaticInit1bf592390398b3f4608da27e3f630485
     );
 
     public static $prefixDirsPsr4 = array (
+        'yiier\\AliyunOSS\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/yiier/yii2-aliyun-oss',
+        ),
         'yii\\swiftmailer\\' => 
         array (
             0 => __DIR__ . '/..' . '/yiisoft/yii2-swiftmailer',

+ 55 - 2
vendor/composer/installed.json

@@ -532,7 +532,8 @@
             "data",
             "faker",
             "fixtures"
-        ]
+        ],
+        "abandoned": true
     },
     {
         "name": "guzzlehttp/guzzle",
@@ -1004,7 +1005,8 @@
         "keywords": [
             "JOSE",
             "base64url"
-        ]
+        ],
+        "abandoned": true
     },
     {
         "name": "lcobucci/jwt",
@@ -1970,6 +1972,57 @@
         ],
         "homepage": "http://www.workerman.net"
     },
+    {
+        "name": "yiier/yii2-aliyun-oss",
+        "version": "dev-master",
+        "version_normalized": "9999999-dev",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/yiier/yii2-aliyun-oss.git",
+            "reference": "ce1587cd58466cdf3a593f78532a210f2645f76a"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/yiier/yii2-aliyun-oss/zipball/ce1587cd58466cdf3a593f78532a210f2645f76a",
+            "reference": "ce1587cd58466cdf3a593f78532a210f2645f76a",
+            "shasum": "",
+            "mirrors": [
+                {
+                    "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                    "preferred": true
+                }
+            ]
+        },
+        "require": {
+            "aliyuncs/oss-sdk-php": ">2.0",
+            "yiisoft/yii2": "*"
+        },
+        "time": "2020-06-08T06:35:54+00:00",
+        "type": "yii2-extension",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "yiier\\AliyunOSS\\": ""
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "forecho",
+                "email": "caizhenghai@gmail.com"
+            }
+        ],
+        "description": "Yii2 阿里云 OSS",
+        "keywords": [
+            "AliyunOSS",
+            "extension",
+            "oss",
+            "yii2"
+        ]
+    },
     {
         "name": "yiisoft/yii2",
         "version": "2.0.29",

+ 4 - 0
vendor/yiier/yii2-aliyun-oss/.github/FUNDING.yml

@@ -0,0 +1,4 @@
+# These are supported funding model platforms
+
+open_collective: yiier
+custom: ['https://blog-1251237404.cos.ap-guangzhou.myqcloud.com/20190424153510.png', 'https://blog-1251237404.cos.ap-guangzhou.myqcloud.com/20190424153431.png']

+ 241 - 0
vendor/yiier/yii2-aliyun-oss/FileUploadAction.php

@@ -0,0 +1,241 @@
+<?php
+/**
+ * author     : forecho <caizhenghai@gmail.com>
+ * createTime : 2019-08-04 09:16
+ * description:
+ */
+
+namespace yiier\AliyunOSS;
+
+use Yii;
+use yii\base\Action;
+use yii\base\DynamicModel;
+use yii\base\InvalidConfigException;
+use yii\helpers\FileHelper;
+use yii\web\Response;
+use yii\web\UploadedFile;
+
+class FileUploadAction extends Action
+{
+    /**
+     * 上传文件的 file 参数名
+     * @var string
+     */
+    public $fileParam = 'filename';
+
+    /**
+     * @link https://www.yiiframework.com/doc/guide/2.0/en/input-validation#ad-hoc-validation
+     * @var array
+     */
+    public $validationRules = [
+        [
+            'file',
+            'file',
+            'extensions' => ['png', 'jpeg', 'jpg', 'gif', 'webp', 'bmp'],
+            'checkExtensionByMimeType' => false,
+            'mimeTypes' => 'image/*',
+            'maxSize' => 5 * 1024 * 1024
+        ]
+    ];
+
+    /**
+     * 文件名生成的方式,默认用 md5
+     * @var callable
+     */
+    public $fileSaveNameCallback;
+
+    /**
+     * 文件保存的方法,默认用 UploadedFile::saveAs()
+     * @var callable
+     */
+    public $saveFileCallback;
+
+    /**
+     * 返回结果回调函数
+     * @var callable
+     */
+    public $returnCallback;
+
+    /**
+     * @var bool
+     */
+    public $normalizePath = 'auto';
+
+    /**
+     * 文件保存路径
+     * @var string
+     */
+    public $savePath = '@webroot/uploads';
+
+    /**
+     * 文件显示的路径
+     * @var string
+     */
+    public $webPath = '@web/uploads';
+
+    /**
+     * @var string
+     */
+    public $uploadSaveErrorMassage = '上传的文件保存失败';
+
+    /**
+     * 是否保留本地文件
+     * @var bool
+     */
+    public $keepLocalFile = false;
+
+    /**
+     * @inheritdoc
+     */
+    public function init()
+    {
+        Yii::$app->response->format = Response::FORMAT_JSON;
+        Yii::$app->request->enableCsrfValidation = false;
+        if ($this->normalizePath === 'auto') {
+            $this->normalizePath = strpos($this->savePath, '..') !== false;
+        }
+        parent::init();
+    }
+
+    /**
+     * @inheritdoc
+     *
+     * @return array
+     * @throws InvalidConfigException
+     */
+    public function run()
+    {
+        $uploadedFiles = UploadedFile::getInstancesByName($this->fileParam);
+        $resultData = [];
+        foreach ($uploadedFiles as $key => $uploadedFile) {
+            $validationModel = DynamicModel::validateData(['file' => $uploadedFile], $this->validationRules);
+            if ($validationModel->hasErrors()) {
+                $errorMassage = $validationModel->getFirstError('file');
+                break;
+            }
+            try {
+                $filename = $this->getFileName($uploadedFile);
+                if (!$this->saveFile($uploadedFile, $filename)) {
+                    throw new \Exception($this->uploadSaveErrorMassage);
+                }
+                $this->uploadOSS($filename);
+                if (!$this->keepLocalFile) {
+                    $this->deleteLocalFile($filename);
+                }
+                $resultData[$key] = $this->getFullFilename($filename, $this->webPath);
+                continue;
+            } catch (\Exception $e) {
+                Yii::error($e, 'upload error');
+                $errorMassage = $e->getMessage();
+                break;
+            }
+        }
+
+        if (isset($errorMassage)) {
+            // 失败了要删除之前的
+            foreach ($resultData as $resultDatum) {
+                $this->deleteFile($resultDatum);
+            }
+            return $this->parseResult(500, $errorMassage);
+        }
+        return $this->parseResult(0, '', $resultData);
+    }
+
+
+    /**
+     * @param $uploadedFile UploadedFile
+     * @param string $filename
+     * @return bool
+     * @throws \yii\base\Exception
+     */
+    protected function saveFile(UploadedFile $uploadedFile, string $filename)
+    {
+        $filename = $this->getFullFilename($filename, $this->savePath);
+        if ($this->saveFileCallback && is_callable($this->saveFileCallback)) {
+            return call_user_func($this->saveFileCallback, $filename, $uploadedFile, $this);
+        }
+        FileHelper::createDirectory(dirname($filename));
+        return $uploadedFile->saveAs($filename);
+    }
+
+
+    /**
+     * @param $uploadedFile UploadedFile
+     * @return string
+     * @throws \Exception
+     */
+    private function getFileName($uploadedFile)
+    {
+        if ($this->fileSaveNameCallback && is_callable($this->fileSaveNameCallback)) {
+            $filename = call_user_func($this->fileSaveNameCallback, $uploadedFile, $this);
+        } else {
+            $filename = md5(microtime() . random_int(10000, 99999));
+        }
+        if (strpos($filename, '.') === false) {
+            $filename .= '.' . $uploadedFile->getExtension();
+        }
+        return $filename;
+    }
+
+    /**
+     * @param $filename
+     * @param $path
+     * @return bool|string
+     */
+    protected function getFullFilename($filename, $path)
+    {
+        $filename = Yii::getAlias(rtrim($path, '/') . '/' . $filename);
+        if ($this->normalizePath) {
+            return FileHelper::normalizePath($filename);
+        }
+        return $filename;
+    }
+
+    /**
+     * Parse result
+     * @param int $code
+     * @param string $message
+     * @param array $data
+     * @return array
+     */
+    protected function parseResult(int $code, $message = '', $data = [])
+    {
+        if ($this->returnCallback && is_callable($this->returnCallback)) {
+            return call_user_func($this->returnCallback, $code, $message, $data);
+        }
+        return ['code' => $code, 'massage' => $message, 'data' => $data];
+    }
+
+    /**
+     * @param string $fileWebName
+     * @throws InvalidConfigException
+     */
+    protected function deleteFile(string $fileWebName)
+    {
+        $fileWebNames = explode('/', $fileWebName);
+        $this->deleteLocalFile(end($fileWebNames));
+        $oss = \Yii::$app->get('oss');
+        $oss->delete(ltrim($fileWebName, '/'));
+    }
+
+    /**
+     * @param string $filename
+     */
+    protected function deleteLocalFile(string $filename)
+    {
+        $fileAbsoluteName = $this->getFullFilename($filename, $this->savePath);
+        @unlink($fileAbsoluteName);
+    }
+
+    /**
+     * @param string $filename
+     * @throws InvalidConfigException
+     */
+    public function uploadOSS(string $filename)
+    {
+        $fileAbsoluteName = $this->getFullFilename($filename, $this->savePath);
+        $fileWebName = $this->getFullFilename($filename, $this->webPath);
+        $oss = \Yii::$app->get('oss');
+        $oss->upload(ltrim($fileWebName, '/'), $fileAbsoluteName);
+    }
+}

+ 197 - 0
vendor/yiier/yii2-aliyun-oss/OSS.php

@@ -0,0 +1,197 @@
+<?php
+/**
+ * author     : forecho <caizhenghai@gmail.com>
+ * createTime : 2016/3/16 18:56
+ * description:
+ */
+
+namespace yiier\AliyunOSS;
+
+use OSS\OssClient;
+use yii\base\Component;
+use yii\base\InvalidConfigException;
+
+class OSS extends Component
+{
+    /**
+     * @var string 阿里云OSS AccessKeyID
+     */
+    public $accessKeyId;
+
+    /**
+     * @var string 阿里云OSS AccessKeySecret
+     */
+    public $accessKeySecret;
+
+    /**
+     * @var string 阿里云的bucket空间
+     */
+    public $bucket;
+
+    /**
+     * @var string OSS内网地址, 如:oss-cn-hangzhou-internal.aliyuncs.com
+     */
+    public $lanDomain;
+
+    /**
+     * @var string OSS外网地址, 如:oss-cn-hangzhou.aliyuncs.com
+     */
+    public $wanDomain;
+
+    /**
+     * @var OssClient
+     */
+    private $_ossClient;
+
+    /**
+     * 从lanDomain和wanDomain中选取, 默认走外网
+     * @var string 最终操作域名
+     */
+    protected $baseUrl;
+
+    /**
+     * @var bool 是否私有空间, 默认公开空间
+     */
+    public $isPrivate = false;
+
+    /**
+     * @var bool 上传文件是否使用内网,免流量费
+     */
+    public $isInternal = false;
+
+    public function init()
+    {
+        if ($this->accessKeyId === null) {
+            throw new InvalidConfigException('The "accessKeyId" property must be set.');
+        } elseif ($this->accessKeySecret === null) {
+            throw new InvalidConfigException('The "accessKeySecret" property must be set.');
+        } elseif ($this->bucket === null) {
+            throw new InvalidConfigException('The "bucket" property must be set.');
+        } elseif ($this->lanDomain === null) {
+            throw new InvalidConfigException('The "lanDomain" property must be set.');
+        } elseif ($this->wanDomain === null) {
+            throw new InvalidConfigException('The "wanDomain" property must be set.');
+        }
+
+        $this->baseUrl = $this->isInternal ? $this->lanDomain : $this->wanDomain;
+    }
+
+    /**
+     * @return \OSS\OssClient
+     * @throws \OSS\Core\OssException
+     */
+    public function getClient()
+    {
+        if ($this->_ossClient === null) {
+            $this->setClient(new OssClient($this->accessKeyId, $this->accessKeySecret, $this->baseUrl));
+        }
+        return $this->_ossClient;
+    }
+
+    /**
+     * @param \OSS\OssClient $ossClient
+     */
+    public function setClient(OssClient $ossClient)
+    {
+        $this->_ossClient = $ossClient;
+    }
+
+    /**
+     * @param $path
+     * @return bool
+     * @throws \OSS\Core\OssException
+     */
+    public function has($path)
+    {
+        return $this->getClient()->doesObjectExist($this->bucket, $path);
+    }
+
+    /**
+     * @param $path
+     * @return bool
+     * @throws \OSS\Core\OssException
+     */
+    public function read($path)
+    {
+        if (!($resource = $this->readStream($path))) {
+            return false;
+        }
+        $resource['contents'] = stream_get_contents($resource['stream']);
+        fclose($resource['stream']);
+        unset($resource['stream']);
+        return $resource;
+    }
+
+    /**
+     * @param $path
+     * @return array|bool
+     * @throws \OSS\Core\OssException
+     */
+    public function readStream($path)
+    {
+        $url = $this->getClient()->signUrl($this->bucket, $path, 3600);
+        $stream = fopen($url, 'r');
+        if (!$stream) {
+            return false;
+        }
+        return compact('stream', 'path');
+    }
+
+    /**
+     * @param $fileName string 文件名 eg: '824edb4e295892aedb8c49e4706606d6.png'
+     * @param $filePath string 要上传的文件绝对路径 eg: '/storage/image/824edb4e295892aedb8c49e4706606d6.png'
+     * @return null
+     * @throws \OSS\Core\OssException
+     */
+    public function upload($fileName, $filePath)
+    {
+        return $this->getClient()->uploadFile($this->bucket, $fileName, $filePath);
+    }
+
+    /**
+     * 删除文件
+     * @param $path
+     * @return bool
+     * @throws \OSS\Core\OssException
+     */
+    public function delete($path)
+    {
+        return $this->getClient()->deleteObject($this->bucket, $path) === null;
+    }
+
+    /**
+     * 创建文件夹
+     * @param $dirName
+     * @return array|bool
+     * @throws \OSS\Core\OssException
+     */
+    public function createDir($dirName)
+    {
+        $result = $this->getClient()->createObjectDir($this->bucket, rtrim($dirName, '/'));
+        if ($result !== null) {
+            return false;
+        }
+        return ['path' => $dirName];
+    }
+
+    /**
+     * 获取 Bucket 中所有文件的文件名,返回 Array。
+     * @param array $options = [
+     *      'max-keys'  => max-keys用于限定此次返回object的最大数,如果不设定,默认为100,max-keys取值不能大于1000。
+     *      'prefix'    => 限定返回的object key必须以prefix作为前缀。注意使用prefix查询时,返回的key中仍会包含prefix。
+     *      'delimiter' => 是一个用于对Object名字进行分组的字符。所有名字包含指定的前缀且第一次出现delimiter字符之间的object作为一组元素
+     *      'marker'    => 用户设定结果从marker之后按字母排序的第一个开始返回。
+     * ]
+     * @return array
+     * @throws \OSS\Core\OssException
+     */
+    public function getAllObject($options = [])
+    {
+        $objectListing = $this->getClient()->listObjects($this->bucket, $options);
+        $objectKeys = [];
+        foreach ($objectListing->getObjectList() as $objectSummary) {
+            $objectKeys[] = $objectSummary->getKey();
+        }
+        return $objectKeys;
+    }
+}

+ 109 - 0
vendor/yiier/yii2-aliyun-oss/README.md

@@ -0,0 +1,109 @@
+Yii2 Aliyun OSS
+===============
+Yii2 阿里云 OSS
+
+[![Latest Stable Version](https://poser.pugx.org/yiier/yii2-aliyun-oss/v/stable)](https://packagist.org/packages/yiier/yii2-aliyun-oss) 
+[![Total Downloads](https://poser.pugx.org/yiier/yii2-aliyun-oss/downloads)](https://packagist.org/packages/yiier/yii2-aliyun-oss) 
+[![Latest Unstable Version](https://poser.pugx.org/yiier/yii2-aliyun-oss/v/unstable)](https://packagist.org/packages/yiier/yii2-aliyun-oss) 
+[![License](https://poser.pugx.org/yiier/yii2-aliyun-oss/license)](https://packagist.org/packages/yiier/yii2-aliyun-oss)
+
+Installation
+------------
+
+The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
+
+Either run
+
+```
+php composer.phar require --prefer-dist yiier/yii2-aliyun-oss "*"
+```
+
+or add
+
+```
+"yiier/yii2-aliyun-oss": "*"
+```
+
+to the require section of your `composer.json` file.
+
+
+Usage
+-----
+
+配置文件添加组件  :
+
+```php
+components => [
+    'oss' => [
+        'class' => 'yiier\AliyunOSS\OSS',
+        'accessKeyId' => 'xxxxx', // 阿里云OSS AccessKeyID
+        'accessKeySecret' => 'xxxx', // 阿里云OSS AccessKeySecret
+        'bucket' => 'xxx', // 阿里云的bucket空间
+        'lanDomain' => 'oss-cn-hangzhou-internal.aliyuncs.com', // OSS内网地址
+        'wanDomain' => 'oss-cn-hangzhou.aliyuncs.com', //OSS外网地址
+        'isInternal' => true // 上传文件是否使用内网,免流量费(选填,默认 false 是外网)
+    ],
+]
+```
+
+```php
+/** @var \yiier\AliyunOSS\OSS $oss */
+$oss = \Yii::$app->get('oss');
+$fh = '/vagrant/php/baseapi/web/storage/image/824edb4e295892aedb8c49e4706606d6.png';
+$oss->upload('824edb4e295892aedb8c49e4706606d6.png', $fh);
+
+或者
+
+$oss->upload('storage/image/824edb4e295892aedb8c49e4706606d6.png', $fh); // 会自动创建文件夹
+
+其他用法
+
+$oss->createDir('storage/image/'); //创建文件夹
+$oss->delete('824edb4e295892aedb8c49e4706606d6.png'); // 删除文件
+$oss->delete('storage/image/824edb4e295892aedb8c49e4706606d6.png'); // 删除文件,如果这个文件是此文件夹的最后一个文件,则会把文件夹一起删除
+$oss->delete('storage/image/'); // 删除文件夹,但是要确保是空文件夹
+$oss->getAllObject(); // 获取根目录下的所有文件名,默认是100个
+$oss->getAllObject(['prefix' => 'storage/image/']); // 获取 `storage/image/` 目录下的所有文件名,默认是100个
+```
+
+
+### Upload action
+
+
+视图文件:
+
+```php
+<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
+    <?= $form->field($model, 'images[]')->fileInput() ?>
+    <div class="form-group">
+        <?= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?>
+    </div>
+<?php ActiveForm::end(); ?>
+```
+
+控制器:
+
+```php
+namespace admin\controllers;
+
+use yii\web\Controller;
+use yiier\AliyunOSS\FileUploadAction;
+
+class FileController extends Controller
+{
+    public function actions()
+    {
+        return [
+            'upload-images' => [
+                'class' => FileUploadAction::class,
+                'fileParam' => 'images',
+                'keepLocalFile' => true, // default false
+                'savePath' => '@webroot/uploads',
+                'webPath' => '@web/uploads',
+            ],
+        ];
+    }
+}
+```
+
+PS:请求的参数 `images` 值是个数组

+ 22 - 0
vendor/yiier/yii2-aliyun-oss/composer.json

@@ -0,0 +1,22 @@
+{
+    "name": "yiier/yii2-aliyun-oss",
+    "description": "Yii2 阿里云 OSS",
+    "type": "yii2-extension",
+    "keywords": ["yii2","extension","AliyunOSS","OSS"],
+    "license": "BSD-3-Clause",
+    "authors": [
+        {
+            "name": "forecho",
+            "email": "caizhenghai@gmail.com"
+        }
+    ],
+    "require": {
+        "yiisoft/yii2": "*",
+        "aliyuncs/oss-sdk-php": ">2.0"
+    },
+    "autoload": {
+        "psr-4": {
+            "yiier\\AliyunOSS\\": ""
+        }
+    }
+}

+ 9 - 0
vendor/yiisoft/extensions.php

@@ -94,4 +94,13 @@ return array (
       '@yii/imagine' => $vendorDir . '/yiisoft/yii2-imagine/src',
     ),
   ),
+  'yiier/yii2-aliyun-oss' => 
+  array (
+    'name' => 'yiier/yii2-aliyun-oss',
+    'version' => '9999999-dev',
+    'alias' => 
+    array (
+      '@yiier/AliyunOSS' => $vendorDir . '/yiier/yii2-aliyun-oss',
+    ),
+  ),
 );