syships/yii2-qiniu 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

syships/yii2-qiniu

最新稳定版本:0.0.5

Composer 安装命令:

composer require syships/yii2-qiniu

包简介

The qiniu SDK for the Yii2 framework

README 文档

README

This is a personal plugin for study. It is strongly recomended that you not use it. This plugin is unstable.

It is the qiniu plugin for yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist syships/yii2-qiniu "*"

or add

"syships/yii2-qiniu": "*"

to the require section of your composer.json file.

Usage

Before using the extension,you can add the _ide_helper.php under your application folder.

Once the extension is installed, simply use it in your code by :

config:

'components' => [
    'qiniu' => [
        'class' => 'syships\qiniu\Application',
        'accessKey' => "QdgHxWgNAhwiKLbzKtUgdNajI6wZopUEXLGN7Ujf",
        'secretKey' => "EKG9b3QW3YsVI0ID-xzDZFbd6I9E-Npey6pnYvI9"
    ],
],

You can use the code below:

use Qiniu\Storage\UploadManager;
use Yii;
use yii\web\UploadedFile;

$image = UploadedFile::getInstanceByName('image');
$fileName = 'image_' . time() .rand(1000,9999). '.' . $image->getExtension();
$upToken = Yii::$app->qiniu->Auth()->uploadToken("syships-imgs");
$uploadMgr = new UploadManager();
list($result, $error) = $uploadMgr->putFile($upToken, $fileName, $image->tempName);

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-07-14