hoa/stream
Hoa\Stream provides an object-oriented abstraction layer for PHP streams, wrapping resources with consistent APIs for reading, writing, filtering, and context handling. It simplifies working with files, sockets, and custom stream wrappers while preserving native stream behavior.
Stream class plus capability interfaces (In, Out, Path, Bufferable, Lockable, Pointable, Statable, Selectable), a custom-stream-wrapper registration mechanism, and filter/context/listener helpers. That interface surface is a useful spec for scoping an internal abstraction — even if we build our own, this tells us what capabilities a stream wrapper must advertise.s3://, encrypted://, memory://, log://) or a composable filter chain (compression, encoding, hashing on read/write), this package defines the shape of that work and the edge cases (seekability, locking, stat, select) we'd otherwise discover late.IStream capability split makes it straightforward to substitute in-memory or fixture-backed streams in unit tests instead of touching the real filesystem or network — a legitimate argument for introducing an abstraction here, not necessarily this one.Consider it when:
Look elsewhere when:
nyholm/psr7) with a client such as Guzzle.league/flysystem.Adoption criteria (all must hold): existing usage in a system we own · code isolated behind an internal adapter interface · PHP version pinned and tested · no unforked CVE exposure · a named owner · a dated plan to replace or explicitly accept the risk.
For executives (one paragraph): Hoa\Stream is a small, well-designed PHP library that wraps the language's file, socket, and stream handling in a clean object-oriented API. It is also archived, with no release since 2017, modest community traction (~300 stars), and no active maintainer. My recommendation is no new adoption: the strategic value is a design reference, not a dependency. There is no commercial upside to standardizing on unmaintained code, and the downside is a permanent, unbudgeted maintenance obligation and a security-response gap. If any current system depends on it, I'd like a small, time-boxed remediation item to isolate or replace it — measured in days, not a project.
For engineering leads: Treat it as a frozen reference implementation, not a dependency. What's worth stealing is the design: the split of stream behaviour into narrow capability interfaces, the wrapper registration pattern, and the filter/context separation. What's not worth taking is the code — it predates modern PHP typing, has no CI against current runtimes, and gives us no upstream to escalate to. The replacement path is short: native stream_wrapper_register behind our own interface for custom schemes, league/flysystem where the need is really storage abstraction, and PSR-17 factories where the need is HTTP. Where the need is only test doubles for I/O, a small in-house adapter gets us the same benefit with full ownership and a test suite we control.
Ask: (1) approve "no new dependencies on archived packages" as a standing rule; (2) authorize a scoped inventory of existing usage; (3) if usage exists, fund a replace-or-isolate ticket with a hard deadline rather than an open-ended support commitment.
How can I help you explore Laravel packages today?