innmind / io
High level abstraction for streams and sockets
3.1.0
2025-04-21 13:24 UTC
Requires
- php: ~8.2
- innmind/immutable: ~5.13
- innmind/ip: ~3.2
- innmind/time-continuum: ^4.0.2
- innmind/url: ~4.3
- innmind/validation: ~2.0
Requires (Dev)
- innmind/black-box: ~6.1
- innmind/coding-standard: ~2.0
- innmind/static-analysis: ^1.2.1
This package is auto-updated.
Last update: 2025-04-21 13:25:27 UTC
README
High level abstraction to work with files and sockets in a declarative way.
Installation
composer require innmind/io
Usage
use Innmind\IO\IO; use Innmind\Url\Path; use Innmind\Immutable\Str; $chunks = IO::fromAmbienAuthority() ->files() ->read(Path::of('/some/file.ext')) ->toEncoding(Str\Encoding::ascii) ->chunks(8192); // max length of each chunk
The $chunks
variable is a Innmind\Innmutable\Sequence
containing Innmind\Immutable\Str
values, where each value is of a maximum length of 8192
bytes.
Documentation
Full documentation can be found at https://innmind.org/io/.