PHPackages                             yilu-tech/file-center - 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. yilu-tech/file-center

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

yilu-tech/file-center
=====================

filesystem

1.0.1(5y ago)01.3kMITPHPPHP &gt;=7.0.0

Since Nov 28Pushed 4y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

Yilu-Tech file-center
=====================

[](#yilu-tech-file-center)

文件管理服务

安装
--

[](#安装)

#### 安装包

[](#安装包)

```
    composer require yilu-tech/file-center

```

#### 注册provider

[](#注册provider)

```
    // 服务端 route provider
    YiluTech\FileCenter\FileServiceProvider::class

    // 内网客户端 client provider, 使用 facade 需注入
    YiluTech\FileCenter\FileClientServiceProvider::class

    // 如果使用 OSS
    YiluTech\FileCenter\AliyunOss\AliyunOssServiceProvider::class

```

#### 服务端配置

[](#服务端配置)

```
    // 在 filesystems.php 添加 buckets

    // 例：
    "buckets" => [
        $bucket => [            // $bucket bucket名称
            "disk" => "oss",    // 磁盘驱动
            "root" => "dev"     // root目录
        } ...
    ]

```

#### 内网客户端配置

[](#内网客户端配置)

```
    // .env
    FILE_CENTER_BUCKET=$bucket
    FILE_CENTER_URI_PREFIX=    // 链接前缀

```

实例
--

[](#实例)

#### 服务端

[](#服务端)

```
public function uploadImage(Request $request)       // 文件上传
{
    if ($request->has('cut')) { // 判断是否需要裁剪图片
        $rules = [
            'image' => 'required|file|max:2048',
            'src_x' => 'required|numeric',
            'src_y' => 'required|numeric',
            'dst_w' => 'required|numeric|min:8',
            'dst_h' => 'required|numeric|min:8',
            'src_w' => 'required|numeric|min:8',
            'src_h' => 'required|numeric|min:8',
        ];
    } else {
        $rules = [
            'images' => 'required|array|min:1',
            'images.*' => 'file|max:2048'
        ];
    }
    $rules['bucket'] = 'required|string|max:16';        // bucket

    $this->validate($request, $rules);

    $server = new Server($request->input('bucket')); // 初始实例

    $is_temp = (int)$request->input('temp', 1);     // 判断是否存到暂存目录，默认开启

    if ($request->has('cut')) {
        return $is_temp ? $server->storeTempWithCut($request->all()) :
            $server->storeWithCut($request->all());
    } else {
        foreach ($request->file('images') as $item) {
            $paths[] = $is_temp ? $server->storeTemp($item) : $server->store($item);
        }
        return $paths;
    }
}
```

#### 内网客户端

[](#内网客户端)

```
    try {
        \DB::beginTransaction();
        \FileCenterClient::prefix($prefix)->prepare();

        \DB::table('xx')->insert([...]);
        \FileCenterClient::move('$temp/2018-01-01/xxx.png');
        \FileCenterClient::delete('xxx.png');

        \FileCenterClient::commit();  //  在数据库之前 commit
        \DB::commit();

    } cache(\Exception $exception) {
        \DB::rollback();
        \FileCenterClient::rollback();  //  在数据库之后 rollback
    }

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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.

###  Release Activity

Cadence

Every ~124 days

Total

3

Last Release

1740d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb3c0cf7cb789f83b86b4a450ba1766d6d6b81c51465c5654a62ab9ffb3f98ff?d=identicon)[yilu-tech](/maintainers/yilu-tech)

---

Top Contributors

[![gatherchou](https://avatars.githubusercontent.com/u/8440791?v=4)](https://github.com/gatherchou "gatherchou (1 commits)")

### Embed Badge

![Health badge](/badges/yilu-tech-file-center/health.svg)

```
[![Health](https://phpackages.com/badges/yilu-tech-file-center/health.svg)](https://phpackages.com/packages/yilu-tech-file-center)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M73](/packages/unisharp-laravel-filemanager)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[iidestiny/flysystem-oss

Flysystem adapter for the Oss storage.

95607.5k25](/packages/iidestiny-flysystem-oss)[yii2-starter-kit/yii2-file-kit

Yii2 file upload and storage kit

151216.8k6](/packages/yii2-starter-kit-yii2-file-kit)[xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. Support PHP8. aliyuncs/oss-sdk-php ~2.6

51505.3k28](/packages/xxtime-flysystem-aliyun-oss)

PHPackages © 2026

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