PHPackages                             kor3k/flysystem-stream-wrapper - 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. kor3k/flysystem-stream-wrapper

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

kor3k/flysystem-stream-wrapper
==============================

A stream wrapper for Flysystem V2 &amp; V3.

07.4k↓86.7%2PHP

Since May 13Pushed 1mo agoCompare

[ Source](https://github.com/kor3k/flysystem-stream-wrapper)[ Packagist](https://packagist.org/packages/kor3k/flysystem-stream-wrapper)[ RSS](/packages/kor3k-flysystem-stream-wrapper/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (15)Used By (2)

Flysystem Stream Wrapper
========================

[](#flysystem-stream-wrapper)

[![Author](https://camo.githubusercontent.com/f7f4b78e6905bcc447517f1d77b7160678f98c9ad66899a442b7114bb8e09d1f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406d326d746563682d626c75652e7376673f7374796c653d666c61742d737175617265)](http://www.m2m.at)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

---

This package provides a stream wrapper for Flysystem V2 &amp; V3.

Flysystem V1
------------

[](#flysystem-v1)

If you're looking for Flysystem 1.x support, check out the [twistor/flysystem-stream-wrapper](https://github.com/twistor/flysystem-stream-wrapper).

Installation
------------

[](#installation)

```
composer require m2mtech/flysystem-stream-wrapper
```

Usage
-----

[](#usage)

```
use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter;
use M2MTech\FlysystemStreamWrapper\FlysystemStreamWrapper;

$filesystem = new Filesystem(new LocalFilesystemAdapter('/some/path'));
FlysystemStreamWrapper::register('fly', $filesystem);

file_put_contents('fly://filename.txt', $content);
mkdir('fly://happy_thoughts');

FlysystemStreamWrapper::unregister('fly');
```

The stream wrapper implements [`symfony/lock`](https://symfony.com/doc/current/components/lock.html) due to Flysystem V2 not supporting locking. By default, file locking using `/tmp` is used, but you can adjust this through configuration:

```
FlysystemStreamWrapper::register('fly', $filesystem, [
    FlysystemStreamWrapper::LOCK_STORE => 'flock:///tmp',
    FlysystemStreamWrapper::LOCK_TTL => 300,
]);
```

### Handling Visibility Issues

[](#handling-visibility-issues)

Some adaptors might throw exceptions when dealing with visibility. If you encounter such issues, configure the stream wrapper to bypass them:

```
FlysystemStreamWrapper::register('fly', $filesystem, [
    FlysystemStreamWrapper::IGNORE_VISIBILITY_ERRORS => true,
]);
```

### Addressing Directory Issues (`file_exists` / `is_dir`)

[](#addressing-directory-issues-file_exists--is_dir)

Some adaptors might not return dates for the last modified attribute for directories. In such cases, you can enable emulation to achieve the desired behavior:

```
FlysystemStreamWrapper::register('fly', $filesystem, [
    FlysystemStreamWrapper::EMULATE_DIRECTORY_LAST_MODIFIED => true,
]);
```

### Dealing with `is_readable` / `is_writable`

[](#dealing-with-is_readable--is_writable)

Some filesystem functions depend on the `uid` and `gid` of the user executing PHP. Since a reliable cross-platform method to derive these values isn't available, the wrapper attempts to estimate them. If this fails, set them manually:

```
FlysystemStreamWrapper::register('fly', $filesystem, [
    FlysystemStreamWrapper::UID => 1000,
    FlysystemStreamWrapper::GID => 1000,
]);
```

Alternatively, access the parameters for [`PortableVisibilityConverter`](https://flysystem.thephpleague.com/docs/usage/unix-visibility/) directly:

```
FlysystemStreamWrapper::register('fly', $filesystem, [
    FlysystemStreamWrapper::VISIBILITY_FILE_PUBLIC => 0644,
    FlysystemStreamWrapper::VISIBILITY_FILE_PRIVATE => 0600,
    FlysystemStreamWrapper::VISIBILITY_DIRECTORY_PUBLIC => 0755,
    FlysystemStreamWrapper::VISIBILITY_DIRECTORY_PRIVATE => 0700,
    FlysystemStreamWrapper::VISIBILITY_DEFAULT_FOR_DIRECTORIES => Visibility::PRIVATE,
]);
```

Testing
-------

[](#testing)

This package was developed using PHP 7.4 and has been tested for compatibility with PHP versions 7.2 through 8.3.

To test:

- With PHP installed:

```
composer test
```

- Inside a Docker environment for PHP 7.4:

```
docker compose run php74 composer test
```

**Note**: PHPUnit v10, used from PHP 8.1 onwards, requires a different config file:

```
docker compose run php81 composer test10
```

Changelog
---------

[](#changelog)

For information on recent changes, refer to the [CHANGELOG](CHANGELOG.md).

Contributing
------------

[](#contributing)

For contribution guidelines, see [CONTRIBUTING](.github/CONTRIBUTING.md).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security vulnerabilities, please follow [our security policy](../../security/policy) for reporting.

Credits
-------

[](#credits)

- This package was inspired by [twistor/flysystem-stream-wrapper](https://github.com/twistor/flysystem-stream-wrapper). Many thanks to [Chris Leppanen](https://github.com/twistor).
- [All Contributors](../../contributors)

License
-------

[](#license)

Licensed under the MIT License. See the [License File](LICENSE.md) for more details.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance59

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 74.4% 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 ~249 days

Recently: every ~598 days

Total

12

Last Release

1321d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/888273?v=4)[kor3k](/maintainers/kor3k)[@kor3k](https://github.com/kor3k)

---

Top Contributors

[![twistor](https://avatars.githubusercontent.com/u/42400?v=4)](https://github.com/twistor "twistor (131 commits)")[![m2mtech](https://avatars.githubusercontent.com/u/1568448?v=4)](https://github.com/m2mtech "m2mtech (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![dkarlovi](https://avatars.githubusercontent.com/u/209225?v=4)](https://github.com/dkarlovi "dkarlovi (1 commits)")[![andruha](https://avatars.githubusercontent.com/u/698990?v=4)](https://github.com/andruha "andruha (1 commits)")[![kor3k](https://avatars.githubusercontent.com/u/888273?v=4)](https://github.com/kor3k "kor3k (1 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (1 commits)")[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (1 commits)")[![briceflaceliere](https://avatars.githubusercontent.com/u/5811531?v=4)](https://github.com/briceflaceliere "briceflaceliere (1 commits)")[![danut007ro](https://avatars.githubusercontent.com/u/1083134?v=4)](https://github.com/danut007ro "danut007ro (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kor3k-flysystem-stream-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/kor3k-flysystem-stream-wrapper/health.svg)](https://phpackages.com/packages/kor3k-flysystem-stream-wrapper)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.0k](/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.5M85](/packages/unisharp-laravel-filemanager)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40432.5M136](/packages/league-flysystem-bundle)[alexusmai/laravel-file-manager

File manager for Laravel

1.2k803.2k9](/packages/alexusmai-laravel-file-manager)

PHPackages © 2026

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