kor3k / flysystem-stream-wrapper
将 Flysystem 文件系统适配到 PHP 流封装器。
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-09-23 03:01:27 UTC
README
安装
composer require twistor/flysystem-stream-wrapper
用法
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');
注意事项
此项目试图尽可能逼真地模拟标准 PHP 函数的行为,如 rename()、mkdir()、unlink() 等。这包括发出警告。如果发现任何差异,请提交问题。