PHPackages                             silentred/lumen-qiniu-storage - 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. silentred/lumen-qiniu-storage

ActiveLibrary

silentred/lumen-qiniu-storage
=============================

Qiniu Resource (Cloud) Storage for Lumen

4778↓100%2[2 issues](https://github.com/silentred/lumen-qiniu-storage/issues)PHP

Since Feb 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/silentred/lumen-qiniu-storage)[ Packagist](https://packagist.org/packages/silentred/lumen-qiniu-storage)[ RSS](/packages/silentred-lumen-qiniu-storage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Qiniu 云储存 Lumen Storage
=======================

[](#qiniu-云储存-lumen-storage)

Developed based on

- Support multiple buckets

Install
-------

[](#install)

- `composer require silentred/lumen-qiniu-storage`
- In `bootstrap/app.php` ，add `$app->register(silentred\QiniuStorage\QiniuFilesystemServiceProvider::class);`
- In `config/filesystem.php`, find `disks` array, append the following configuration：

```
    'qiniu' => [
        'driver'  => 'qiniu',
        'buckets' => [
            'first'=> [
                'scheme' => 'http',
                'domain' => '7xnpza.com1.z0.glb.clouddn.com',
                'name' => 'app-service'
            ],
            'second' => [
                'scheme' => 'http',
                'domain' => '7xpf8a.com1.z0.glb.clouddn.com',
                'name' => 'im-service'
            ]
        ],
        'access_key'=> '',  //AccessKey
        'secret_key'=> '',  //SecretKey
        'notify_url'=> '',  //callback url, not using
    ]

```

\*\* NOTICE: The default bucket is the first one. \*\*

Usage
-----

[](#usage)

```
    $disk = \Storage::disk('qiniu');
    $disk->withBucket('second')                     // change to the second bucket
    $disk->withBucket('first')->exists('file.jpg'); // check if file exists in first bucket;
    //now the following operation is under first bucket

    $disk->exists('file.jpg');                      //文件是否存在
    $disk->get('file.jpg');                         //获取文件内容
    $disk->put('file.jpg',$contents);               //上传文件
    $disk->prepend('file.log', 'Prepended Text');   //附加内容到文件开头
    $disk->append('file.log', 'Appended Text');     //附加内容到文件结尾
    $disk->delete('file.jpg');                      //删除文件
    $disk->delete(['file1.jpg', 'file2.jpg']);

    $disk->copy('old/file1.jpg', 'new/file1.jpg');  //复制文件到新的路径
    $disk->withBucket('first')->toBucket('second')  // copy file.jpg from first bucket to second bucket
         ->copy('old/file.jpg', 'new/file.jpg');

    $disk->move('old/file1.jpg', 'new/file1.jpg');  //移动文件到新的路径
    $disk->withBucket('first')->toBucket('second')  // move file.jpg from first bucket to second bucket
        ->move('old/file1.jpg', 'new/file1.jpg');

    $size = $disk->size('file1.jpg');               //取得文件大小
    $time = $disk->lastModified('file1.jpg');       //取得最近修改时间 (UNIX)
    $files = $disk->files($directory);              //取得目录下所有文件
    $files = $disk->allFiles($directory);               //这个没实现。。。
    $directories = $disk->directories($directory);      //这个也没实现。。。
    $directories = $disk->allDirectories($directory);   //这个也没实现。。。
    $disk->makeDirectory($directory);               //这个其实没有任何作用
    $disk->deleteDirectory($directory);             //删除目录，包括目录下所有子文件子目录

    $disk->uploadToken('file.jpg');                //获取上传token
    $disk->downloadUrl('file.jpg');                //获取下载地址
    $disk->downloadUrl('file.jpg', 'https');       //获取HTTPS下载地址
    $disk->privateDownloadUrl('file.jpg');         //获取私有bucket下载地址
    $disk->privateDownloadUrl('file.jpg', 'https');//获取私有bucket的HTTPS下载地址
    $disk->imageInfo('file.jpg');                  //获取图片信息
    $disk->imageExif('file.jpg');                  //获取图片EXIF信息
    $disk->imagePreviewUrl('file.jpg','imageView2/0/w/100/h/200');                         //获取图片预览URL
    $disk->persistentFop('file.flv','avthumb/m3u8/segtime/40/vcodec/libx264/s/320x240');   //执行持久化数据处理
    $disk->persistentFop('file.flv','fop','队列名');   //使用私有队列执行持久化数据处理
    $disk->persistentStatus($persistent_fop_id);       //查看持久化数据处理的状态。
```

官方SDK / 手册
----------

[](#官方sdk--手册)

-
-

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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/80d16c8ab751ec78351272d9f13e66b5439e12635d2d44ca70ba9aff81d58230?d=identicon)[silentred](/maintainers/silentred)

---

Top Contributors

[![silentred](https://avatars.githubusercontent.com/u/3345293?v=4)](https://github.com/silentred "silentred (2 commits)")

### Embed Badge

![Health badge](/badges/silentred-lumen-qiniu-storage/health.svg)

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

PHPackages © 2026

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