twistor/flysystem-stream-wrapper

将Flysystem文件系统适配到PHP流包装器。

v1.0.9 2018-11-14 06:41 UTC

This package is auto-updated.

Last update: 2024-09-04 11:29:51 UTC


README

Author Build Status AppVeyor Coverage Status Software License Packagist Version Total Downloads

安装

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()等的行为。这包括发出警告。如果发现任何差异,请提交问题。