[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] [NOT SOLVEDish] Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jochem Maas
Jochem Maas schreef: ... indeed ... I tested it and it works on my server too. my code is no different to yours with regard to the context of the problem. so what's going on. I think (I know) I forgot to mention one tiny little detail. the whole 'include' code occurs in a script that forks

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;