PHPackages                             phalapi/qiniu - 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. phalapi/qiniu

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

phalapi/qiniu
=============

PhalApi 2.x 扩展类库：七牛云存储接口调用

51.0k↓92%2PHP

Since Jun 26Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

七牛扩展
====

[](#七牛扩展)

PhalApi 2.x扩展类库，基于Qiniu的七牛CDN扩展。

安装和配置
-----

[](#安装和配置)

修改项目下的composer.json文件，并添加：

```
    "phalapi/qiniu":"dev-master"

```

然后执行`composer update`。

安装成功后，添加以下配置到/path/to/phalapi/config/app.php文件：

```
    /**
     * 七牛相关配置
     */
    'Qiniu' =>  array(
        //统一的key
        'access_key' => '*****',
        'secret_key' => '****',
        //自定义配置的空间
        'space_bucket' => '自定义配置的空间',
        'space_host' => 'http://XXXXX.qiniudn.com', // 如果有配置此项，则优先使用此域名
        'preffix' => '', // 上传文件名前缀
        //'upload_url' => '', // 提示：incorrect region, please use up-z2.qiniup.com，请配置此域名
    ),
```

并根据自己的情况修改填充。

注册
--

[](#注册)

在/path/to/phalapi/config/di.php文件中，注册：

```
$di->qiniu = function() {
        return new \PhalApi\Qiniu\Lite();
};
```

使用
--

[](#使用)

第一种使用方式：使用七牛上传本地文件：

```
$url = \PhalApi\DI()->qiniu->uploadFile($file);
```

第二种使用方式：或者，直接使用已经提供的默认上传接口。在composer.json中追加配置：

```
"autoload": {
    "psr-4": {
        "Qiniu\\": "vendor/phalapi/qiniu/src/qiniu"
    }
}

```

打开在线接口文档列表，即可看到七牛的接口。

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 57.9% 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/35d70b1236f8f67d96ba3da4ba88889faf2837ff8f7ab62acc54fe6cb4992c87?d=identicon)[dogstarhuang](/maintainers/dogstarhuang)

---

Top Contributors

[![phalapi](https://avatars.githubusercontent.com/u/12585518?v=4)](https://github.com/phalapi "phalapi (11 commits)")[![dogstarTest](https://avatars.githubusercontent.com/u/6116306?v=4)](https://github.com/dogstarTest "dogstarTest (8 commits)")

### Embed Badge

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

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

PHPackages © 2026

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