阿里云 OSS 官方 SDK 的 Composer 封装,支持 yii2 项目。
Switch branches/tags
Nothing to show
Clone or download
Latest commit fc41dd8 Jun 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src ++ 增加bucket操作相关 Jun 22, 2018
test first commit Nov 30, 2017
.gitignore first commit Nov 30, 2017
README.md ++ update readme Jun 22, 2018
composer.json first commit Nov 30, 2017
composer.lock first commit Nov 30, 2017

README.md

Yii2 阿里云 OSS

安装

composer require mrk/yii2-aliyun-oss:@dev

or add

"mrk/yii2-aliyun-oss":"@dev"

使用

在 main.php 文件中做如下修改

components => [
    'oss' => [
        'class' => 'mrk\aliyun\OSS',
        'accessKeyId' => 'xxxxx', // 阿里云AccessKeyID
        'accessKeySecret' => 'xxxx', // 阿里云 AccessKeySecret
        'bucket' => 'xxx', // bucket
        'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com', //OSS节点地址
    ],
]

在 controller 中

 \Yii::$app->oss->upload($object,$file);