dev-master
9999999-dev https://github.com/yiizh/yii2-storageThe storage extension for Yii2.
MIT
The Requires
by Di.Zhang
extension yii2 storage
The storage extension for Yii2.
This extension provides support for multi storage., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist yiizh/yii2-storage "dev-master"
or add, (*4)
"yiizh/yii2-storage": "*"
to the require section of your composer.json
file., (*5)
Change config file :, (*6)
... 'components' => [ 'storage' => [ 'class'=>'\yiizh\storage\LocalStorage', 'basePath' => '@app/web/uploads' ] ] ...
... 'components' => [ 'storage' => [ 'class' => '\yiizh\storage\AliyunStorage', 'accessKey' => '<您从OSS获得的AccessKeyId>', 'accessSecret' => '<您从OSS获得的AccessKeySecret>', 'endpoint' => '<您选定的OSS数据中心访问域名,例如oss-cn-hangzhou.aliyuncs.com>', 'bucket' => '<您的绑定在某个Bucket上的自定义域名>', ] ] ...
\Yii::$app->storage->save('文件名', '文件内容');
The storage extension for Yii2.
MIT
extension yii2 storage