PHPackages                             callmez/yii2-file-system - 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. callmez/yii2-file-system

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

callmez/yii2-file-system
========================

This extension provides a filesystem solution for Yii 2.

1.01(11y ago)2727733[2 issues](https://github.com/callmez/yii2-file-system/issues)MITPHP

Since Nov 13Pushed 10y ago3 watchersCompare

[ Source](https://github.com/callmez/yii2-file-system)[ Packagist](https://packagist.org/packages/callmez/yii2-file-system)[ RSS](/packages/callmez-yii2-file-system/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

yii2-file-system
================

[](#yii2-file-system)

Yii2-file-system是 [Flysystem](https://github.com/thephpleague/flysystem)基础上基于 [Yii2](https://github.com/yiisoft/yii2) 框架的实现的扩展。 **任何存储,统一的函数调用**

\###扩展存储

- Qinu 七牛云存储

### 将要实现的功能 (欢迎PR)

[](#将要实现的功能-欢迎pr)

- 阿里云存储
- 又拍云存储 (未实现大文件流API\[还是老牌存储...\], 如果实现功能后.大文件操作会有资源要求)
- 百度云存储
- 新浪云存储

使用要求
====

[](#使用要求)

- php &gt;= 5.4
- [Flysystem](https://github.com/thephpleague/flysystem)

使用教程
====

[](#使用教程)

\###使用`Componser`安装 (以下2种方式)

- 命令行执行 `composer require callmez/yii2-file-system`
- 编辑`composer.json`

    ```
    "require": {
        ...
        "callmez/yii2-file-system": "*"
    },
    ```

### 编辑配置文件(2种使用方式)

[](#编辑配置文件2种使用方式)

- 编辑`config/main.php`

    ```
    'components' => [
      'fileSystem' => [
        'class' => 'callmez\file\system\Collection',
            'fileSystems' => [
                //根据需求可设置多个存储, 以下来使用例子
                'local' => function() {
                    return new \callmez\file\system\FileSystem(
                        new \callmez\file\system\adapters\Local(\Yii::getAlias('@webroot\images'))
                    );
                },
                'qiniu' => function() {
                    return new \callmez\file\system\FileSystem(
                        new \callmez\file\system\adapters\Qiniu(
                            '七牛空间的 bucket',
                            '七牛空间的 access key',
                            '七牛空间的 access secret',
                            '七牛的空间域名,默认为 {bucket}.qiniu.com 选填'
                        )
                    );
                }
            ]
      ]
    ]
    ```
- 使用例子(推荐wrapper方式)

    ```
      // 集合方式
      $local = Yii::$app->fileSystem->get('local');
      $local->write('test.txt', 'hello world');
      echo $local->read('test.txt');

      $qiniu = Yii::$app->fileSystem->get('qiniu');
      $qiniu->write('test.txt', 'hello world');
      echo $qiniu->read('test.txt');

      // wrapper 方式 (推荐)
      //等同于Yii::$app->fileSystem->get('local')->write('test.txt', 'hello world');
      Yii::$app->fileSystem->write('local://test.txt', 'hello world');
      //等同于Yii::$app->fileSystem->get('qiniu')->write('test.txt', 'hello world');
      Yii::$app->fileSystem->write('qiniu://test.txt', 'hello world');
    ```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~8 days

Total

4

Last Release

4174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/133ed7e990d10a18e1c6feab2a12143d5367755c76fe211222bfcdd4741412b6?d=identicon)[callmez](/maintainers/callmez)

---

Top Contributors

[![callmez](https://avatars.githubusercontent.com/u/1625891?v=4)](https://github.com/callmez "callmez (40 commits)")

---

Tags

Flysystemfilestorageyii2systemqiniu

### Embed Badge

![Health badge](/badges/callmez-yii2-file-system/health.svg)

```
[![Health](https://phpackages.com/badges/callmez-yii2-file-system/health.svg)](https://phpackages.com/packages/callmez-yii2-file-system)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[league/flysystem-async-aws-s3

AsyncAws S3 filesystem adapter for Flysystem.

2610.5M31](/packages/league-flysystem-async-aws-s3)

PHPackages © 2026

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