stadly/file-waiter-bytestring

FileWaiter的字节串文件适配器。

v1.0.1 2021-09-10 09:46 UTC

This package is auto-updated.

Last update: 2024-09-10 16:14:33 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

FileWaiter的字节串文件适配器FileWaiter

安装

通过Composer

$ composer require stadly/file-waiter-bytestring

用法

use Stadly\FileWaiter\Adapter\ByteString;
use Stadly\FileWaiter\File;
use Stadly\FileWaiter\Waiter;

$content = 'FILE CONTENT STORED AS STRING';

$streamFactory = new \GuzzleHttp\Psr7\HttpFactory();        // Any PSR-17 compatible stream factory.
$file = new File(new ByteString($content, $streamFactory));

$responseFactory = new \GuzzleHttp\Psr7\HttpFactory();      // Any PSR-17 compatible response factory.
$waiter = new Waiter($file, $responseFactory);

// Serve the byte string using FileWaiter.

变更日志

请参阅CHANGELOG以获取最近更改的详细信息。

测试

$ composer test

贡献

请参阅CONTRIBUTINGCODE_OF_CONDUCT以获取详细信息。

安全性

如果您发现任何与安全相关的问题,请通过电子邮件[email protected]联系,而不是使用问题跟踪器。

致谢

许可证

MIT许可证(MIT)。请参阅LICENSE以获取更多信息。