PHPackages                             dwd/qiniu-sdk-bundle - 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. dwd/qiniu-sdk-bundle

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

dwd/qiniu-sdk-bundle
====================

31891PHP

Since Mar 22Pushed 9y ago4 watchersCompare

[ Source](https://github.com/Doweidu/DWDQiniuSdkBundle)[ Packagist](https://packagist.org/packages/dwd/qiniu-sdk-bundle)[ RSS](/packages/dwd-qiniu-sdk-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (2)Used By (0)

七牛PHP-SDK Bundle
================

[](#七牛php-sdk-bundle)

在symfony2中使用七牛的SDK

安装
--

[](#安装)

编辑`composer.json`，添加bundle的地址，并添加依赖：

```
...
"repositories": [
...
    {
        "type": "vcs",
        "url": "git@bitbucket.org:duoweidu/dwdqiniubundle.git"
    }
],
...
"require": {
...
    "dwd/qiniu-sdk-bundle": "dev-master",
...
}
...

```

修改配置文件 `app/config/parameters.yml.dist`添加以下几项配置项：

```
parameters:
...
    qiniu_sdk_accessKey: ~
    qiniu_sdk_secretKey: ~
    qiniu_sdk_bucket: ~
    qiniu_sdk_domain: ~

```

更新依赖：

```
$ composer update dwd/qiniu-sdk-bundle

```

修改`app/AppKernel.php`，加载`DWDQiniuSdkBundle`：

```
$bundles = array(
...
    new DWD\QiniuSdkBundle\DWDQiniuSdkBundle(),
);

```

清除缓存：

```
app/console cache:clear

```

使用
--

[](#使用)

PHP中：

```
$qiniu = $this->container->get('dwd_qiniu_sdk');
$rs = $qiniu->put('', ''); //上传文本内容，可以直接把内容上传，使用key可以取到一个文本资源
$rs = $qiniu->putFile('', ''); //上传本地文件，指定文件路径即可
$rs = $qiniu->delete(''); //从七牛删除一个资源
$rs = $qiniu->batchDelete(''[, '', ...]); //从七牛删除同一个bucket的多个资源
$rs = $qiniu->mv('', 'new-key-name', ''); //移动一个资源，第三个参数可选，默认是同一个bucket内移动
$rs = $qiniu->batchMv(array('old'=>'', 'new'=>'new-key1-name')[, array('old'=>'', 'new'=>'new-key2-name'), ...]); //移动同一个bucket的多个资源
$rs = $qiniu->copy('', 'to-key-name', ''); //复制一个资源，第三个参数可选，默认是同一个bucket内复制
$rs = $qiniu->batchCopy(array('from'=>'', 'to'=>'to-key1-name')[, array('from'=>'', 'to'=>'to-key2-name'), ...]); //复制同一个bucket的多个资源
$rs = $qiniu->stat(''); //获取资源信息，包括文件大小(fsize)，哈希值(hash)，类型(mimeType)，上传时间(putTime)
$rs = $qiniu->batchStat(''[, '', ...]); //批量获取文件信息，返回一个数组，code是指资源状态，正常资源是200，data中是和stat相同字段的列表数组

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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://www.gravatar.com/avatar/7a11b2da8069bf09a9608b9c7aa194860149da7fca12209cd78bd3221bd6da71?d=identicon)[scourgen](/maintainers/scourgen)

---

Top Contributors

[![taojuntjpp](https://avatars.githubusercontent.com/u/1578430?v=4)](https://github.com/taojuntjpp "taojuntjpp (5 commits)")[![wpp0525](https://avatars.githubusercontent.com/u/10482901?v=4)](https://github.com/wpp0525 "wpp0525 (1 commits)")

### Embed Badge

![Health badge](/badges/dwd-qiniu-sdk-bundle/health.svg)

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

###  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)
