output-buffering

Zend Cache not working using Action Helper

Hi, I'm trying to implement full page static caching in my Zend Framework application. Using the Static backend coupled with the Capture frontend, whole pages can be cached, and served by a .htaccess redirect in the future, until the cache is deleted/regenerated. For reference, I've been using the section on Zend_Cache_Backend_Static in...

Disable output buffering on my local xampp server

For some reason my xampp server is buffering the output of my php. I want it to spit it out as it goes. Anyone any ideas which settings I need to change to achieve this? Thanks ...

Is there a way to make PHP progressively output as the script executes?

So I'm writing a disposable script for my own personal single use and I want to be able see how the process is going. Basically I'm processing a couple of thousand media releases and sending them to our new CMS. So I don't hammer the CMS, I'm making the script sleep for a couple of seconds after every 5 requests. I would like - as the ...

How to show loading animation before printing buffer content from ob_start()...?

Hi Everyone.... I have a script that runs for quite a while and i am using ob_start() to buffer the output and print the result after the script finishes executing... I need to show some loading animation while the script executes and replace it with the output when the script finishes executing... I know that it can be done quite bea...

insert in the head tag after wp_head

Using wordpress 2.9.2. I am loading my css files for plugins as they are being called, which ofcourse is after my header has been loaded. I want to insert the calls those css files in the HEAD tag of the page, which can be done if i get a hook which includes lines in the head after wp_head() has been called. Help ! ...

what is output buffering?

can anybody explain me what is output buffering and why one is using it in php? ...

Is output buffering more expensive than FS hit?

That's about it. Is OB heavier than including a file? ...

emacs/Python: running python-shell in line buffered vs. block buffered mode

Hi all - In a related question and answer here, someone hypothesized that python-shell within emacs(23.2) was block-buffered instead of line-buffered. The recommended fix was to add sys.stdout.flush() to the spot in my script where I want stdio to flush its contents to the python-shell. Is there someway to trick python-shell (running i...

Use case for output buffering as the correct solution to "headers already sent"

I see (not just on this site) a lot of question from inexperienced PHP programmers about the infamous "headers already sent... output started at" error, and many people suggest using ouput buffering as a solution. In my experience I have never found a situation where that error wasn't caused by a flaw in the program's logic. Are there c...

Generation of formatted files with Ruby in the way how it can be done with PHP

Hi, I use PHP to generate files of some special format, and I have decided to try the same thing with Ruby. To make a file with PHP, I use the following code: <? include 'functions_and_settings.php'; ob_start() ?> some parts of another format <? // php functions generating file content, // including other formatted files ?> some ...

Stop PHP output buffering

Hi, I need to display continuous output from my php script. The script will stay in a loop of printing log data from a device and sleeping. My problem is that I can't get PHP or Apache to output data before the script is completed. I have tried all the commands for flushing the output buffer, and I have read through the config-files for...

How do headers work with output buffering in PHP?

Title is self-explanatory. I have a good bit of experience with PHP, but I am not sure how the header function works between ob_start() and ob_end_clean(). Consider this: ob_start(); echo "Some content"; header('X-Example-Header: foo'); echo "Some more content"; $output = ob_get_contents(); ob_end_clean(); echo $output; Does the ...

PHP output buffering not working

Hello, I have a php file that I am trying to send the output in a email using the php mail function (PHPMailer is not an option as the server I am working restricts their SMTP server). The code for the mail function is $to = "[email protected]"; $subject = "Outdoor Grill Service Request"; ob_start(); require 'grill-form.php'; $body = ob_get_...

strange ob_start() behaviour - double output

Hey all, ob_start() doesn't seem to be stopping any output so when I flush the buffer it's doubling up <?php ob_start(); echo "Text..... <br />"; echo ob_get_flush(); ?> Outputs Text..... Text..... But I was expecting Text..... Any ideas ? Thanks ...

About using method "print" etc. in ERB for metaprogramming

I am using ERB via console for metaprogramming (for math software). For example, I have file test.erb containing text line before ruby <%= 'via <%=' %> <% print 'print' %> <% puts 'puts' %> text line after ruby When I parse it by $ erb test.erb, I get the following output printputs text line before ruby via <%= text line af...

PHP output buffering to text file

I am having trouble with an update script. It runs for a few hours so I would like it to output live to a text file. I start the document with ob_start(); Then within the while loop (as it iterates through the records of the database) I have this $size=ob_get_length(); if ($size > 0) { $content = ob_get_contents(); logit($co...

Included PHP scripts can't access $_POST when output buffering?

I have an HTML form POSTing to the following index.php: <?php require_once("/home/full/path/to/included/file.php"); ?> And in file.php, I am trying to access $_POST: ob_start(); session_start(); var_dump($_POST); $contents = ob_get_contents(); ob_end_clean(); echo $contents; But var_dump($_POST) returns an empty array. Moving the ...

Powershell: How to capture output from the host

I am using powershell to automate some tasks related to checking out/merging in TFS. When I call tf get * /recurse I get a bunch of data scrolling by about the files that are getting checked out. The last line generated by this command (assuming its success) is one telling the checkin number. I would like to parse this out so it c...

Nested output buffering with external class dependencies [please help]

Thanks in advance for any and all advice. I have one file (content file) where an array is created like so: $config['plugins']['BannerRotate'] = array( 'container' => 'abroadView', 'arrows' => true, 'auto' => true, 'speed' => '15000', 'width' => '300px', 'height' => ...

ob_get_level() starts at level 1

Having a few problems with output buffering. Mainly, I'm trying to run output buffering with the ob_gzhandler callback, but it keeps telling me its using an unsupported compression type. Everything is enabled, and I believe the problem is that running ob_get_level() at the start of my script produces a level of 1. php.ini has my output_b...