Re: [PHP] output buffering in CLI script.

2008-02-29 Thread Jochem Maas
Greg Donald schreef: On 2/28/08, Casey <[EMAIL PROTECTED]> wrote: #!/usr/bin/php Or the entirely more portable version: #!/usr/bin/env php thanks for the tip :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] output buffering in CLI script.

2008-02-29 Thread Greg Donald
On 2/28/08, Casey <[EMAIL PROTECTED]> wrote: > #!/usr/bin/php Or the entirely more portable version: #!/usr/bin/env php http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jim Lucas
Casey wrote: On Thu, Feb 28, 2008 at 3:39 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: hi there, I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being output (an

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 3:39 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: > hi there, > > I can't seem to manage to buffer output (of an included file) in a CLI > script, > the following does not work: > > > // buffer output so we can avoid the shebang line being > output (an

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 data = ltrim($bucket->data,"#!/usr/bin/php\n"); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } stream_filter_register("trim.shebang", "trimshebang"); include "php://filter/rea

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 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 data = ltrim($bucket->data,"#!".PHP_BINDIR."/php\n"); $consumed += $bucket->datalen; stream_bucket_

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 data = ltrim($bucket->data,"#!/usr/bin/php\n"); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } stream_filter_register("trim.shebang", "trimshebang"); include "php://filter/read=

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

2008-02-28 Thread Nathan Rixham
how's this? #!/usr/bin/php data = ltrim($bucket->data,"#!/usr/bin/php\n"); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } stream_filter_register("trim.shebang", "trimshebang"); include "php://filter/read=trim.shebang/resource=

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

2008-02-28 Thread Jochem Maas
Stuart Dallas schreef: On 28 Feb 2008, at 12:29, Jochem Maas wrote: Stuart Dallas schreef: On 28 Feb 2008, at 11:52, Stut wrote: On 28 Feb 2008, at 11:39, Jochem Maas wrote: I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work:

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jochem Maas
Nathan Rixham schreef: Jochem Maas wrote: ... -Stut bit of false logic here but have you tried: eval(ltrim(file_get_contents($script),$shebang)); haven't tried it, did consider it. I hate eval() :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://ww

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Aschwin Wesselius
Jochem Maas wrote: I mean that the shebang line at the top of the included file is output to stdout even when I turn on output buffering on prior to including the file. nothing else is output but that's because the script doesn't generate any further output - it logs everything instead - and

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Stuart Dallas
On 28 Feb 2008, at 12:29, Jochem Maas wrote: Stuart Dallas schreef: On 28 Feb 2008, at 11:52, Stut wrote: On 28 Feb 2008, at 11:39, Jochem Maas wrote: I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer outp

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Nathan Rixham
Jochem Maas wrote: Stut schreef: On 28 Feb 2008, at 11:39, Jochem Maas wrote: I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being output (and strip it from the

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jochem Maas
Stuart Dallas schreef: On 28 Feb 2008, at 11:52, Stut wrote: On 28 Feb 2008, at 11:39, Jochem Maas wrote: I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being out

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jochem Maas
Stut schreef: On 28 Feb 2008, at 11:39, Jochem Maas wrote: I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being output (and strip it from the output we log)

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jochem Maas
Andrés Robinet schreef: -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Thursday, February 28, 2008 6:39 AM To: [php] PHP General List Subject: [PHP] output buffering in CLI script. hi there, I can't seem to manage to buffer output (of an included file) in a CLI scr

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Stuart Dallas
On 28 Feb 2008, at 11:52, Stut wrote: On 28 Feb 2008, at 11:39, Jochem Maas wrote: I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being output (and strip it from

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Stut
On 28 Feb 2008, at 11:39, Jochem Maas wrote: I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being output (and strip it from the output we log)

RE: [PHP] output buffering in CLI script.

2008-02-28 Thread Andrés Robinet
> -Original Message- > From: Jochem Maas [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 28, 2008 6:39 AM > To: [php] PHP General List > Subject: [PHP] output buffering in CLI script. > > hi there, > > I can't seem to manage to buffer output (of an included file) in a CLI > script, >