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 |
State ⇒ Rejected
State ⇒ Feedback
State ⇒ Accepted
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ CLI enchanment to read in blocks from stdin
Queue ⇒ Horde Framework Packages
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.