codementality / flysystem-stream-wrapper
Adapts Flysystem filesystems to PHP stream wrappers. (fork of twistor/flysystem-stream-wrapper_
Installs: 5 935
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- codementality/stream-util: v2.0.0
- league/flysystem: ^1.0.9
Requires (Dev)
- phpspec/prophecy-phpunit: ^2.3
- phpunit/phpunit: ^11.5.3
Replaces
This package is auto-updated.
Last update: 2025-03-09 18:48:55 UTC
README
This package is a forked and updated version of the original package, twistor/flysystem-stream-wrapper. It has been updated to run on PHP 8.2+, and unit tests have been uppdated for PHPUnit 11+.
Installation
composer require codementality/flysystem-stream-wrapper
Usage
use League\Flysystem\Adapter\Local; use League\Flysystem\Filesystem; use Codementality\FlysystemStreamWrapper; // Get a Filesystem object. $filesystem = new Filesystem(new Local('/some/path')); FlysystemStreamWrapper::register('fly', $filesystem); // Then you can use it like so. file_put_contents('fly://filename.txt', $content); mkdir('fly://happy_thoughts'); FlysystemStreamWrapper::unregister('fly');
Notes
This project tries to emulate the behavior of the standard PHP functions, rename(), mkdir(), unlink(), etc., as closely as possible. This includes emitting warnings. If any differences are discovered, please file an issue.