[#3551] CLI enhancement to read blocks from STDIN
Summary CLI enhancement to read blocks from STDIN
Queue Horde Framework Packages
Queue Version HEAD
Type Enhancement
State Rejected
Priority 1. Low
Requester air2@dds.nl
Created 2006-03-01 (5250 days ago)
Updated 2006-04-18 (5202 days ago)
Resolved 2006-04-18 (5202 days ago)
Patch No

air2@dds.nl 2006-03-01 15:46:36
To process the mail, in the mail-filter.php of the whups package, in a 
memory-frieldly way, its necessary to read the input in blocks, write 
them to a file, read the next part etc. instead of reading the whole 
message into  a variable at once. As now happens:

$text = $cli->readStdin();

So I suppose an extension of the CLI in the framework, an extra function:

$cli->readStdinByteRange (&$output, &$read, $bytes)

It returns true if there is more data, and false if the feof is reached.

In this way it can be used in a loop liike this one:

while ($cli->readStdinByteRange (&$output, &$read, $bytes)) {

    fwrite($handle, $output);


An patch containing an little enchangement voor the CLI packages is included.

Chuck Hagenbuch <chuck@horde.org> 2006-03-02 17:35:13
Patch is missing...

Jan Schneider <jan@horde.org> 2006-04-18 10:11:59
No feedback.