PHPackages                             nnmer/qiniu-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. [HTTP &amp; Networking](/categories/http)
4. /
5. nnmer/qiniu-bundle

ActiveLibrary[HTTP &amp; Networking](/categories/http)

nnmer/qiniu-bundle
==================

Symfony2(3) bundle integration with 七牛 (Qiniu) CDN service

368PHP

Since Sep 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/nnmer/qiniu-bundle)[ Packagist](https://packagist.org/packages/nnmer/qiniu-bundle)[ RSS](/packages/nnmer-qiniu-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

This bundle aim is to help to work with [七牛](https://www.qiniu.com/) CDN service.

The work on bundle is in process, the documentation will be updated respectively.

### Installation &amp; Configuration

[](#installation--configuration)

*Note: this bundle doesn't provide any 七牛 frontend related code.*

1. Install: `composer require nnmer/qiniu-bundle`
2. Add bundle AppKernel.php :

```
 ...
 new Nnmer\QiniuBundle(),
 ...
```

3. Add bundle configuration at config.yml

```
nnmer_qiniu:
    accessKey: xxxxxxx
    secretKey: yyyyyyy
    defaultBucket: a1
    initiateAdapters:
        - gaufrette
    buckets: # is an array of the buckets, later each of them will be available as a service. Should be at least 1 provided
        - a1
        - b2
```

4. Add to you routing

```
qiniu_processing_results:
    resource: "@NnmerQiniuBundle/Controller/QiniuCallbackController.php"
    type:     annotation
    prefix:   /
```

5. if you are behind symfony's firewall, then add to your security.yml access\_control section:

```
- { path: ^/qiniu-callback-url, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/qiniu-persistence-notify-url, role: IS_AUTHENTICATED_ANONYMOUSLY }
```

6. Done. From this point once you will receive a callback from Qiniu the 2 events can be raised, depends on the callback:

- `QiniuEvents::FILE_UPLOADED`
- `QiniuEvents::PERSISTENCE_RESULTS_RECEIVED`

the content of the event is the payload of the callback, so you can process you logic by listening to this events and manage the payload data

### Overwriting controller

[](#overwriting-controller)

If you want to have custom controller logic then do either:

- extend `QiniuCallbackController` class (this will give you existing 2 callbacks defined)
- implement `QiniuCallbackControllerInterface` interface (you will need to define the content for the controller's 2 callbacks methods)

In this case remember to repoint routing definition to your content, or remove it if you manage routing definitions yourself

### Available services

[](#available-services)

NOTE: bucket's name in services being renamed from original name: all `-` arereplaces by `_`

After container is built available next services:

`nnmer_qiniu.*_service` , where `*` is each of the `buckets`

and `nnmer_qiniu.service` which is alias to the service with `defaultBucket`

if KnpGaufretteBundle is installed and `nnmer_qiniu.initiateAdapters` has `gaufrette` as array element then additional next services will be generate:

`nnmer_qiniu.gaufrette_*_adapter` where `*` is each of the `buckets`

### Twig helpers

[](#twig-helpers)

`downloadUrl(url, service)` - to build a download link, signed and with time expiration. `service` is the id of the needed service. (in a controller the alias is $this-&gt;container-&gt;get('service id here')-&gt;getAuth()-&gt;privateDownloadUrl($url))

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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://www.gravatar.com/avatar/03a52146f8501186ff925bf77491f7bf6ea42392a8e31be10e24869cfe82ec81?d=identicon)[nnmer](/maintainers/nnmer)

---

Top Contributors

[![nnmer](https://avatars.githubusercontent.com/u/1620737?v=4)](https://github.com/nnmer "nnmer (19 commits)")

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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