stadly / file-waiter-bytestring
Byte string file adapter for FileWaiter.
v1.0.1
2021-09-10 09:46 UTC
Requires
- php: >=7.4
- psr/http-factory: ^1.0
- stadly/file-waiter: *
Requires (Dev)
- guzzlehttp/psr7: ^2.0
- pepakriz/phpstan-exception-rules: ^0.11.7
- php-parallel-lint/php-parallel-lint: ^1.3
- phpstan/phpstan: ^0.12.88
- phpstan/phpstan-deprecation-rules: ^0.12.6
- phpstan/phpstan-phpunit: ^0.12.19
- phpstan/phpstan-strict-rules: ^0.12.9
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- stadly/php-style: ^1.1.1
This package is auto-updated.
Last update: 2024-10-10 16:21:20 UTC
README
Byte string file adapter for FileWaiter.
Install
Via Composer
$ composer require stadly/file-waiter-bytestring
Usage
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.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email magnar@myrtveit.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see LICENSE for more information.