6.0.0-git
2019-07-21

[#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 2006-03-01 (4890 days ago)
Due
Updated 2006-04-18 (4842 days ago)
Assigned
Resolved 2006-04-18 (4842 days ago)
Milestone
Patch No

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