[PHP] Re: [SOLVEDish] Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Nathan Rixham
how's this? #!/usr/bin/php ?php class trimshebang { function filter($in, $out, $consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket-data = ltrim($bucket-data,#!/usr/bin/php\n); $consumed += $bucket-datalen; stream_bucket_append($out,

Re: [PHP] Re: [SOLVEDish] Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Aschwin Wesselius
Nathan Rixham wrote: how's this? #!/usr/bin/php ?php class trimshebang { function filter($in, $out, $consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket-data = ltrim($bucket-data,#!/usr/bin/php\n); $consumed += $bucket-datalen;

Re: [PHP] Re: [SOLVEDish] Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Nathan Rixham
Aschwin Wesselius wrote: Me thinks that when shebang doesn't fit /usr/bin/php (which happens sometimes) you're doomed. [snip] good point.. modified to use BINDIR: #!/usr/bin/php ?php class trimshebang { function filter($in, $out, $consumed, $closing) { while ($bucket =

Re: [PHP] Re: [SOLVEDish] Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jochem Maas
Nathan Rixham schreef: how's this? #!/usr/bin/php ?php class trimshebang { function filter($in, $out, $consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket-data = ltrim($bucket-data,#!/usr/bin/php\n); $consumed += $bucket-datalen;