Questions tagged [output-buffering]

Use output-buffering for questions related to the use of one or more buffers in order to optimize performance by batching write operations

References

414 questions
4
votes
6 answers

PHP: Output buffer callback not altering output

I have an output buffer with callback function. When cleaning the buffer the callback function is executed, however, the string returned isn't being altered. I'm using following code:
Bart
  • 433
  • 3
  • 19
3
votes
1 answer

Output Buffering Not Displaying Error Notice

In my PHP script I had errors turned onto E_ALL. Then around my views I add an output buffer that starts and ends with ob_start()/ob_flush. The problem I am having now is Notices will not be displayed if they occur but Fatal errors will. Does anyone…
Devin Dixon
  • 11,553
  • 24
  • 86
  • 167
3
votes
1 answer

PHP View, working with templates

Well, my question is very simple but a little hard to accept the solution, but anyway .. is the following, I have a 'mini-framework', something to work on writing up of a single scheme, helps me a lot, accelerate work on some things, however, the…
user862010
3
votes
5 answers

Keeping a live connection with php?

I am working on a project has me constantly pinging a php script for new data, so if I understand this correctly that means that the php script being pinged gets run over and over indefinitely. It works but i'm guessing its a huge strain on the…
teh_noob
  • 1,106
  • 3
  • 12
  • 25
3
votes
1 answer

If I use echo a lot, should I use output buffering?

Hi this is a basic question, however I'm not sure about it, so I ask you: If I have more than 100 php echos in my html code, something like this: file.php:

Shaz
  • 2,647
  • 2
  • 35
  • 45
3
votes
2 answers

Confused Man Seeking: "Warning: Cannot modify header information"

I'm very much wanting to see the PHP warning "Cannot modify header information". Why? Because it's sensible. You shouldn't be able to send headers after body. But I can!! If I debug some vars in a controller and don't exit immediately afterwards,…
Rudie
  • 52,220
  • 42
  • 131
  • 173
3
votes
3 answers

What is the purpose of the SerialPort write buffer?

From outside SerialPort object, it seems to make no difference what the size of the write buffer is, and whether or not it is full. Using synchronous writing, the write method blocks until all the data has been sent and the buffer is empty. Using…
HypnoToad
  • 585
  • 1
  • 6
  • 18
3
votes
2 answers

PHP Output Buffering Check?

Possible Duplicate: PHP - How Detect if Output Buffering is Turned On How can I check in PHP if output_buffering is set to On? I have to troubleshoot a site and I have no access to the hosting panel. Something like: if(output_buffering ==…
usnidorg
  • 33
  • 1
  • 3
3
votes
1 answer

Why does print argument flush default to False?

I am using print to log the execution of my python scripts. I use flush = True everywhere because otherwise the print statements sometimes do not occur where they were placed. I was wondering why the default is flush = False. Can anyone…
3
votes
1 answer

detecting user abort with output buffering enabled in PHP

The Notes section in the function documentation of ignore_user_abort() suggest that PHP cannot detect that a user has aborted the request if no data is sent to the client. This is true for the function connection_status(), too. Unfortunately, I need…
soulmerge
  • 73,842
  • 19
  • 118
  • 155
3
votes
4 answers

How can an output buffer worsen performance

I am writing a php script and somewhere before my header() function i have printed text to the browser hereby causing my header() function give me a well known error: Warning: Cannot modify header information - headers already sent. Now my…
War Coder
  • 454
  • 1
  • 7
  • 24
3
votes
1 answer

Can I use ob_clean() without ob_start() before?

I am not used to ob_* functions and I began by reading the documentation. I would like to use ob_clean() in a method but the documentation says: The output buffer must be started by ob_start() with PHP_OUTPUT_HANDLER_CLEANABLE flag. Otherwise…
AymDev
  • 6,626
  • 4
  • 29
  • 52
3
votes
2 answers

How to send output to a file continuously from a piped linux command?

Below command generates output every second for 60 seconds. sar -n DEV 1 60 | grep lo If I redirect it to a file, the file sar.log is updated continuously i.e. every second sar -n DEV 1 60 > sar.log & However, as soon as pipe it and then…
user2250246
  • 3,807
  • 5
  • 43
  • 71
3
votes
3 answers

PHP buffer why \r\n

I have a few conceptual questions (all related, I think) regarding the following script, at the comments. The script works fine.
Ben
  • 54,723
  • 49
  • 178
  • 224
3
votes
1 answer

Real time read from subprocess.stdout on Windows

To emphasize, the problem is real time read instead of non-blocking read. It has been asked before, e.g. subprocess.Popen.stdout - reading stdout in real-time (again). But no satisfactory solution has been proposed. As an example, the following…
cqdjyy01234
  • 1,180
  • 10
  • 20