[PHP] Output buffering

2009-10-07 Thread Arno Kuhl
Has there been a change to the way output buffering works? The manual states for ob_get_contents() This will return the contents of the output buffer or FALSE, if output buffering isn't active. But the following works in php4.4.4 and php5.2.6 whether output buffering is on or not ?php

Re: [PHP] Output buffering

2009-10-07 Thread David Otton
2009/10/7 Arno Kuhl ak...@telkomsa.net: According to the manual I shouldn't see anything at all when output_buffering is off (or if memory serves me correctly I should see an error about headers already sent or something). Looking at phpinfo confirms the value echoed by the script. Has

RE: [PHP] Output buffering

2009-10-07 Thread Arno Kuhl
From: djo...@gmail.com [mailto:djo...@gmail.com] On Behalf Of David Otton Sent: 07 October 2009 10:54 AM To: a...@dotcontent.net Cc: php-general@lists.php.net Subject: Re: [PHP] Output buffering 2009/10/7 Arno Kuhl ak...@telkomsa.net: According to the manual I shouldn't see anything at all when

Re: [PHP] Output buffering

2009-10-07 Thread Shawn McKenzie
Arno Kuhl wrote: Thanks David. After taking another look at the description for ob_start() I began to suspect there was a difference, but the manual doesn't mention anything about it. And the fact they use the same terminolgy for both the settings and the functions is confusing. I can see

Re: [PHP] Output buffering

2009-10-07 Thread David Otton
2009/10/7 Arno Kuhl ak...@telkomsa.net: Thanks David. After taking another look at the description for ob_start() I began to suspect there was a difference, but the manual doesn't mention anything about it. And the fact they use the same terminolgy for both the settings and the functions is

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 ?php -- Greg Donald 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-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 ?php thanks for the tip :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] output buffering in CLI script.

2008-02-28 Thread Jochem Maas
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 (and strip it from the output we log) $oldIFvalue =

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

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 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

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

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
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

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 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

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 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:

[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:

[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;

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 (and strip it

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 (and

[PHP] Output Buffering and zlib Compression Issue

2007-08-03 Thread Chris
When I run the following code (PHP 5.2.2, 5.2.3) via Apache (with an htaccess file), I get this error: Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer zlib output compression. in ... Can anyone explain what's going on? I'm assuming it isn't a bug and I've read the

RE: [PHP] Output Buffering and zlib Compression Issue

2007-08-03 Thread Jan Reiter
- Von: Chris [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 4. August 2007 01:18 An: php-general@lists.php.net Betreff: [PHP] Output Buffering and zlib Compression Issue When I run the following code (PHP 5.2.2, 5.2.3) via Apache (with an htaccess file), I get this error: Notice: ob_end_clean

RE: [PHP] Output Buffering and zlib Compression Issue

2007-08-03 Thread Jan Reiter
Right! With zlib compression ob_start() or similar seems to get called before the user script execution. I'm not quite sure why. Anyhow ob_get_level() returns 2 after the ob_start() is called for the first time in the script. You can avoid the error with while (ob_get_level() 1) {

[PHP] Output Buffering Error? 4.3.10??

2005-08-17 Thread Joe Harman
Hello, is anyone here getting an intermittent error like this one while running output buffering? Warning: Unexpected character in input: ' in /*//tpl.page.product.php on line 10 Parse error: parse error, unexpected T_STRING in

Re: [PHP] output buffering / output compression

2005-06-11 Thread Richard Lynch
On Thu, June 9, 2005 12:22 am, Paul Birnstihl said: I have recently set up a machine with PHP with both buffering and compression turned on. Some of the pages being served include up to 3MB of HTML. Can someone explain the benefit(s) of setting these ini directives to values (ie. larger than

[PHP] output buffering / output compression

2005-06-09 Thread Paul Birnstihl
I have recently set up a machine with PHP with both buffering and compression turned on. Some of the pages being served include up to 3MB of HTML. Can someone explain the benefit(s) of setting these ini directives to values (ie. larger than 4kb) rather than On ? I've played around with it

Re: [PHP] Output buffering - saving + echoing

2004-12-15 Thread Brent Baisley
Not exactly sure what your question is. You want to catch the buffer, but don't delay the buffer to be sent??? If your question is that you want to hold the contents of the buffer and send it only when you are ready, don't use ob_end_flush, use ob_end_clean. The buffer is cleared without

Re: [PHP] Output buffering - saving + echoing

2004-12-15 Thread Lorderon
Hi, Brent Baisley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Not exactly sure what your question is. You want to catch the buffer, but don't delay the buffer to be sent??? If your question is that you want to hold the contents of the buffer and send it only when you are ready,

Re: [PHP] Output buffering - saving + echoing

2004-12-15 Thread Lorderon
Hi, Brent Baisley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Not exactly sure what your question is. You want to catch the buffer, but don't delay the buffer to be sent??? If your question is that you want to hold the contents of the buffer and send it only when you are ready,

Re: [PHP] Output buffering - saving + echoing

2004-12-15 Thread Richard Lynch
Lorderon wrote: What I want to do is catch the output buffer, but do not delay the buffer to be sent. How is it done? I see three options here: #1 Call ob_start/ob_get_contents/ob_flush and repeat that a *LOT* within your script, so that you are buffering only a few lines of text at any given

[PHP] Output buffering - saving + echoing

2004-12-14 Thread Lorderon
Hi, When using ob_start(), the output is buffered and not sent till ob_end_flush() is called or got to end of the script. Also before flushing you can get the buffer contents by ob_get_contents(). ? //start buffering, from now on no output. //NEED: start buffering, but output imediatly when

[PHP] Output buffering (gzip) on Mac OS X 10.3.5

2004-08-12 Thread René Fournier
Zend (http://www.zend.com/zend/art/buffering.php) offers some suggestions on output buffering, which I am trying to implement on my web server (Mac OS X 10.3.5, Apache/1.3.29 (Darwin) PHP/4.3.6). So far, unsuccessfully. Has anyone got this working? Here's what I've got: ?php

[PHP] output buffering display handlers....

2004-03-16 Thread PHPGreen
Hi Folks, I am trying to use outbuffering techniques ob_start(myCallBack) . ob_end_flush() function myCallBack($inBuffer) { //process ob_start(); include aPHPFile.php; $includeFileContents = ob_get_contents(); ob_end_clean(); } I am seeing the following error Cannot

Re: [PHP] output buffering display handlers....

2004-03-16 Thread Tom Rogers
Hi, Wednesday, March 17, 2004, 11:36:02 AM, you wrote: P Hi Folks, P I am trying to use outbuffering techniques P ob_start(myCallBack) P . P ob_end_flush() P function myCallBack($inBuffer) P { P //process P ob_start(); P include aPHPFile.php; P $includeFileContents =

[PHP] output buffering

2003-02-27 Thread Kevin Waterson
I am having some problems with ob_* My goals is basically this htmlStuff goes here ?php header('Content-Type: image/jpeg'); echo file_get_contents('img.jpg';? More stuff here/html The code below works until the showImage method is called, it does show the image however, it does not output the

Re: [PHP] output buffering

2003-02-27 Thread Leif K-Brooks
You can't display an image like that in HTML. You need to make a second PHP script that displays just the image, and call it with a img tag. Kevin Waterson wrote: I am having some problems with ob_* My goals is basically this htmlStuff goes here ?php header('Content-Type: image/jpeg'); echo

Re: [PHP] output buffering problem

2002-11-16 Thread Colin Kettenacker
webmaster [EMAIL PROTECTED] on 11/15/02 3:47 PM wrote: I'm trying to enable output buffering to speed up the load time of some of our php web pages. I've consulted the manual and enabled the following: The manual lacks description for this topic. Take a look at this article at Developer

[PHP] output buffering problem

2002-11-15 Thread webmaster
I'm trying to enable output buffering to speed up the load time of some of our php web pages. I've consulted the manual and enabled the following: output_buffering = On output_handler = ob_gzhandler At the beginning of my .php script, I include the following: ob_start(ob_gzhandler); This

[PHP] Output buffering problem

2002-11-07 Thread Willem Vooys
Hi, I'm having a buffering problem with following combination: -Webserver: Apache 1.3.23 -CGI: PHP 4.2.1 -Client:IE 6.026 (but fails using others as well) Description: I want the output buffer of php being flushed to the client in a time-consuming loop, using the flush() and/or

[PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Jay Blanchard
Howdy group! I am outputting a rather large data set to an Excel spreadsheet from a MySQL database on a healthy FreeBSD server. The Apache server is on the same server as the database. The code looks like this ? /* ** SWB CABS Project ** USOC Charges Detail ** Report By Criteria -

Re: [PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Kevin Stone
] Output Buffering - Am I using it correctly? Howdy group! I am outputting a rather large data set to an Excel spreadsheet from a MySQL database on a healthy FreeBSD server. The Apache server is on the same server as the database. The code looks like this ? /* ** SWB CABS Project ** USOC

RE: [PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Jay Blanchard
[snip] Output buffering is doing nothing for you in the given example. It does not reduce client side resources... if anything it increases the usage serverside resources. Perhaps you are thinking of gz compression? You might use a combination of ob* functions and gz* functions to minimize

RE: [PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Beau Hartshorne
I guess that this means I am out of luck here. Anyone know a cleaner method for delivering spreadsheets? Can you get the server to write it to a file, and then let the client download the file normally? Beau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Jay Blanchard
[snip] I guess that this means I am out of luck here. Anyone know a cleaner method for delivering spreadsheets? Can you get the server to write it to a file, and then let the client download the file normally? [/snip] Believe me, if I could have taken that way out I would have done it. I am

RE: [PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Jay Blanchard
[snip] I am researching some classes [/snip] OK. One of the silly classes fails, saying -- Fatal error: No parent class available in this context in biff.php on line 52 line 52 is -- 49 function BiffWriter() 50 { 51 error_reporting (E_ALL); 52

RE: [PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Beau Hartshorne
Can you get the server to write it to a file, and then let the client download the file normally? [/snip] Believe me, if I could have taken that way out I would have done it. I am researching some classes, but they all seem to take just as long to create the spreadsheet. What about

RE: [PHP] Output Buffering - Am I using it correctly?

2002-09-25 Thread Jay Blanchard
[snip] OK. One of the silly classes fails, saying -- Fatal error: No parent class available in this context in biff.php on line 52 line 52 is -- 49 function BiffWriter() 50 { 51 error_reporting (E_ALL); 52 parent::BiffBase(); 53

[PHP] Output Buffering issues with 4.1.2

2002-09-09 Thread Ron Dyck
I seem to have some trouble with a script using the output buffering functions on a server running v4.1.2. Everything works fine on the box with 4.2.2. Is this an issue with 4.1.2? === Ron Dyck WebbTech www.webbtech.net [EMAIL PROTECTED] -- PHP

[PHP] Output buffering behaviour

2002-02-23 Thread hassan
hi, I'm working on content management system entirely written in Object oriented PHP using templates i used output buffering to be able to send header calls in the middle of my classes i have noticed that performance has become random meaning that the same script could take from 1 up to 30

Re: [PHP] output buffering

2001-04-05 Thread Christian Dechery
At 00:26 5/4/2001 -0500, Plutarck wrote: http://www.php.net/manual/en/ref.outcontrol.php If you want to use output buffering you must use the ob_* family of functions. In any script where you want it used you _must_ use it explicitly, or so do in an included file. Unless you can change the

Re: [PHP] output buffering

2001-04-05 Thread Plutarck
I know what you mean. Until I decided to kill all but one single echo/print call, which is in a function I call at the bottom of the script, I often ran into problems where I needed to echo something at the top of a really really long control loop, but nested deep within it I had to set a cookie

[PHP] output buffering

2001-04-04 Thread Christian Dechery
as I saw on the manual output_buffering cannot be changed at runtime... so there is NO WAY? If I want output_buffering I'll have to do it on all my pages? and does it really cost that much in performance? is it worthed? . Christian Dechery (lemming) .

Re: [PHP] output buffering

2001-04-04 Thread Plutarck
http://www.php.net/manual/en/ref.outcontrol.php If you want to use output buffering you must use the ob_* family of functions. In any script where you want it used you _must_ use it explicitly, or so do in an included file. Unless you can change the php.ini, there is no way to force all pages