PHPackages                             phcent/webman-filesystem - 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. phcent/webman-filesystem

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

phcent/webman-filesystem
========================

Flysystem V2 adapter for the webman

v1.0.0(4y ago)0331MITPHPPHP &gt;=7.2

Since Oct 30Pushed 4y ago1 watchersCompare

[ Source](https://github.com/phcent/webman-filesystem)[ Packagist](https://packagist.org/packages/phcent/webman-filesystem)[ RSS](/packages/phcent-webman-filesystem/feed)WikiDiscussions main Synced 6d ago

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

安装
==

[](#安装)

```
composer require phcent/webman-filesystem

```

在config目录下新建filesystem.php并将下列内容导入

```
return [
    'default' => 'local',
    'storage' => [
        'local' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\LocalAdapterFactory::class,
            'root' => runtime_path(),
        ],
        'ftp' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\FtpAdapterFactory::class,
            'host' => 'ftp.example.com',
            'username' => 'username',
            'password' => 'password',
            // 'port' => 21,
            // 'root' => '/path/to/root',
            // 'passive' => true,
            // 'ssl' => true,
            // 'timeout' => 30,
            // 'ignorePassiveAddress' => false,
            // 'timestampsOnUnixListingsEnabled' => true,
        ],
        'memory' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\MemoryAdapterFactory::class,
        ],
        's3' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\S3AdapterFactory::class,
            'credentials' => [
                'key' => 'S3_KEY',
                'secret' => 'S3_SECRET',
            ],
            'region' => 'S3_REGION',
            'version' => 'latest',
            'bucket_endpoint' => false,
            'use_path_style_endpoint' => false,
            'endpoint' => 'S3_ENDPOINT',
            'bucket_name' => 'S3_BUCKET',
        ],
        'minio' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\S3AdapterFactory::class,
            'credentials' => [
                'key' => 'S3_KEY',
                'secret' => 'S3_SECRET',
            ],
            'region' => 'S3_REGION',
            'version' => 'latest',
            'bucket_endpoint' => false,
            'use_path_style_endpoint' => true,
            'endpoint' => 'S3_ENDPOINT',
            'bucket_name' => 'S3_BUCKET',
        ],
        'oss' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\AliyunOssAdapterFactory::class,
            'accessId' => 'OSS_ACCESS_ID',
            'accessSecret' => 'OSS_ACCESS_SECRET',
            'bucket' => 'OSS_BUCKET',
            'endpoint' => 'OSS_ENDPOINT',
            // 'timeout' => 3600,
            // 'connectTimeout' => 10,
            // 'isCName' => false,
            // 'token' => null,
            // 'proxy' => null,
        ],
        'qiniu' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\QiniuAdapterFactory::class,
            'accessKey' => 'QINIU_ACCESS_KEY',
            'secretKey' => 'QINIU_SECRET_KEY',
            'bucket' => 'QINIU_BUCKET',
            'domain' => 'QINBIU_DOMAIN',
        ],
        'cos' => [
            'driver' => \Phcent\WebmanFilesystem\Adapter\CosAdapterFactory::class,
            'region' => 'COS_REGION',
            'app_id' => 'COS_APPID',
            'secret_id' => 'COS_SECRET_ID',
            'secret_key' => 'COS_SECRET_KEY',
            // 可选，如果 bucket 为私有访问请打开此项
            // 'signed_url' => false,
            'bucket' => 'COS_BUCKET',
            'read_from_cdn' => false,
            // 'timeout' => 60,
            // 'connect_timeout' => 60,
            // 'cdn' => '',
            // 'scheme' => 'https',
        ],
    ],
];

```

- 阿里云 OSS 适配器

```
composer require phcent/flysystem-oss

```

- S3 适配器

```
composer require "league/flysystem-aws-s3-v3:^2.0"

```

- 七牛云适配器

```
composer require "overtrue/flysystem-qiniu:^2.0"

```

- 内存适配器

```
composer require "league/flysystem-memory:^2.0"

```

- 腾讯云 COS 适配器

```
composer require "overtrue/flysystem-cos:^4.0"

```

使用
==

[](#使用)

通过FilesystemFactory::get('local') 来调用不同的适配器

```
    use Phcent\WebmanFilesystem\FilesystemFactory;
    public function upload(Request $request)
    {
        $file = $request->file('file');

        $filesystem =  FilesystemFactory::get('local');
        $stream = fopen($file->getRealPath(), 'r+');
        $filesystem->writeStream(
            'uploads/'.$file-getUploadName(),
            $stream
        );
        fclose($stream);

        // Write Files
        $filesystem->write('path/to/file.txt', 'contents');

        // Add local file
        $stream = fopen('local/path/to/file.txt', 'r+');
        $result = $filesystem->writeStream('path/to/file.txt', $stream);
        if (is_resource($stream)) {
            fclose($stream);
        }

        // Update Files
        $filesystem->update('path/to/file.txt', 'new contents');

        // Check if a file exists
        $exists = $filesystem->has('path/to/file.txt');

        // Read Files
        $contents = $filesystem->read('path/to/file.txt');

        // Delete Files
        $filesystem->delete('path/to/file.txt');

        // Rename Files
        $filesystem->rename('filename.txt', 'newname.txt');

        // Copy Files
        $filesystem->copy('filename.txt', 'duplicate.txt');

        // list the contents
        $filesystem->listContents('path', false);
    }

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1659d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/df539cc9ed77b47bc184c26a9cb989e551f9afb1e8841ea02f25fe66b6b0ee91?d=identicon)[phcent](/maintainers/phcent)

---

Top Contributors

[![phcent](https://avatars.githubusercontent.com/u/70010565?v=4)](https://github.com/phcent "phcent (3 commits)")

---

Tags

filesystemqiniuosscoswebman

### Embed Badge

![Health badge](/badges/phcent-webman-filesystem/health.svg)

```
[![Health](https://phpackages.com/badges/phcent-webman-filesystem/health.svg)](https://phpackages.com/packages/phcent-webman-filesystem)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

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

Flysystem V2 adapter for the webman

2715.4k5](/packages/shopwwi-webman-filesystem)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[yangyifan/upload

上传 SDK for Laravel

12422.6k3](/packages/yangyifan-upload)[alphasnow/aliyun-oss-flysystem

Flysystem adapter for the Aliyun storage

14249.2k4](/packages/alphasnow-aliyun-oss-flysystem)[jerodev/flysystem-v3-smb-adapter

SMB adapter for Flysystem v3

1289.9k1](/packages/jerodev-flysystem-v3-smb-adapter)

PHPackages © 2026

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