PHPackages                             teg1c/thinkphp-qiniu-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. teg1c/thinkphp-qiniu-sdk

ActiveLibrary[File &amp; Storage](/categories/file-storage)

teg1c/thinkphp-qiniu-sdk
========================

基于tp5.1的七牛云sdk，实现了文件上传与文件管理

1805PHP

Since Jun 7Pushed 7y agoCompare

[ Source](https://github.com/teg1c/thinkphp-qiniu-sdk)[ Packagist](https://packagist.org/packages/teg1c/thinkphp-qiniu-sdk)[ RSS](/packages/teg1c-thinkphp-qiniu-sdk/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

thinkphp-qiniu-sdk

基于tp5.1框架的七牛云存储实现，实现文件上传，文件管理功能

composer 安装

`composer require teg1c/thinkphp-qiniu-sdk`

如果该方法安装不成功，请在项目根目录下的composer.json的require中添加

`"teg1c/thinkphp-qiniu-sdk": "dev-master"`

然后使用cmd进入项目根目录下运行composer update

配置使用
====

[](#配置使用)

配置：
---

[](#配置)

在tp5.1的配置文件app.php中配置七牛云的配置参数

```
'qiniu' => [

        'accesskey' => '你自己的七牛云accesskey',
        'secretkey' => '你自己的七牛云secretkey',
        'bucket' => 'bucket',
 ]

```

使用
--

[](#使用)

```
use tegic\qiniu\Qiniu;
try{

      $qiniu = new Qiniu();
      $result = $qiniu->upload();
      dump($result);
    }catch (Exception $e){

      dump($e->getMessage());
    }

```

上传成功则返回的是key值为文件名

直接使用
----

[](#直接使用)

```
  try{

      $qiniu = new Qiniu('你自己的七牛云accesskey','你自己的七牛云secretkey','你自己创建的bucket');
      $result = $qiniu->upload();

 }catch (Exception $e){

      dump($e->getMessage());
 }

```

---

说明：

- 修改了七牛参数配置请清除一下缓存
- upload()方法支持参数传入。可传入第一个参数为要上传文件保存的名称，第二个参数为bucket名称。

第一个参数默认取文件的hash串拼接时间戳time()

第二个参数默认为配置里的bucket

如果使用中有任何错误或者疑问可以给我发邮件：

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27796058?v=4)[tegic](/maintainers/teg1c)[@teg1c](https://github.com/teg1c)

---

Top Contributors

[![tegicz](https://avatars.githubusercontent.com/u/13031739?v=4)](https://github.com/tegicz "tegicz (11 commits)")

### Embed Badge

![Health badge](/badges/teg1c-thinkphp-qiniu-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/teg1c-thinkphp-qiniu-sdk/health.svg)](https://phpackages.com/packages/teg1c-thinkphp-qiniu-sdk)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M61](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
