kor3k / flysystem-stream-wrapper
Adapts Flysystem filesystems to PHP stream wrappers.
v1.0.11
2022-11-19 19:34 UTC
Requires
- league/flysystem: ^1.0.9
- twistor/stream-util: ~1.0
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is not auto-updated.
Last update: 2024-11-18 03:36:12 UTC
README
Installation
composer require twistor/flysystem-stream-wrapper
Usage
use League\Flysystem\Adapter\Local; use League\Flysystem\Filesystem; use Twistor\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 wanrings. If any differences are discovered, please file an issue.