6.0.0-beta1
7/9/25

[#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
Owners
Requester air2 (at) dds (dot) nl
Created 03/01/2006 (7070 days ago)
Due
Updated 04/18/2006 (7022 days ago)
Assigned
Resolved 04/18/2006 (7022 days ago)
Milestone
Patch No

History
04/18/2006 10:11:59 AM Jan Schneider Comment #3
State ⇒ Rejected
Reply to this comment
No feedback.
03/02/2006 05:35:13 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Patch is missing...
03/02/2006 05:34:39 PM Chuck Hagenbuch Summary ⇒ CLI enhancement to read blocks from STDIN
State ⇒ Accepted
 
03/01/2006 03:46:36 PM air2 (at) dds (dot) nl Comment #1
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ CLI enchanment to read in blocks from stdin
Queue ⇒ Horde Framework Packages
Reply to this comment
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.


Saved Queries