Re: [RFC] Io\Terminal
| From: | Pratik Bhujel | Date: | Wed, 07 Oct 2026 03:48:08 +0000 |
| Subject: | Re: [RFC] Io\Terminal | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132823@lists.php.net to get a copy of this message | ||
Hi Jakub,
> I wonder if we should have some stream abstraction.
Thanks for taking a look. I see the benefit of having something shared
across Io, especially if it can support sources beyond streams.
With fromStreams(), one thing I would want to preserve is the supplied
stream's buffering and input behavior, including support for php://memory.
We also need access to the native terminal capabilities for mode changes
and Windows console input.
For this RFC, I would lean towards keeping fromStdio() and fromStreams().
If a suitable shared abstraction becomes available, we could add another
factory for it while keeping these entry points. The ownership and
buffering rules would still need to be worked through.
Did you have a particular abstraction in mind? I would be interested in
understanding whether it would improve the current API, or whether keeping
these factories leaves us enough room to integrate it later.
Regards,
Pratik