I have some classes I am writing unit tests for which have echoes in them. I want to suppress this output and thought ob_start() and ob_clean() would suffice, but they aren't having an effect.
public function testSomething (){
ob_start();
…
I'm dealing with a migration from ColdFusion 9 to ColdFusion 11. One issue I've run into is essentially the same as that detailed in this question: cf10 unable to add text to HTML Head
The root cause in my case is a particular page that weighs in at…
In PHP, I want to read a file into a variable and process the PHP in the file at the same time without using output buffering. Is this possible?
Essentially I want to be able to accomplish this without using ob_start():
I would like to have page content for a web page I am developing appear on screen as it is downloaded. In my test/development environment this works as expected using the PHP flush() command.
However, my production setup (WPEngine) uses an Nginx…
Is there a simple way to detect in PHP if output_buffering is enabled in php.ini? I'd like to be able to display a message if it is not enabled.
Within my application I tried using an htaccess file to automatically enable it but it seems it does not…
I can't seem to find a good answer on this anywhere. If I am running output buffering, and a die() is fired, does that kick off an ob_end_flush() as well?
What are the methods to turn on output buffering either within a PHP script or using and htaccess file?
I use the following method in an htaccess file in the root of my application:
php_value output_buffering On
php_value output_handler…
I'm using PHP, MySQL, Smarty, jQuery, AJAX, etc. for my website. Currently, I'm fetching a large amount of data (matching question IDs) from the MySQL database, do processing on it, assigning this data to the Smarty template and printing it on a…
When performance is important including server memory,I am curious if using output buffering
like ob_start(); in PHP has ANY performance hits over not using it? Does it use more memory or anything to use it?
In my situation on a high traffic…
I have read on many websites that using
ob_start();
can enhance your page load times, as it stores the php in a variable and displays it in one go rather than processing the php a bit of a time.
Also it is extremely useful for
header('location:…
The logging handler classes have a flush() method.
And looking at the code, logging.FileHandler does not pass a specific buffering mode when calling open(). Therefore when you write to a log file, it will be buffered using a default block size.
Is…
I moved my files to a new server and I had a script that instantly showed output on every echo to the browser, but this isn't working on the new server. Here is my test code:
@ini_set('output_buffering', 0); @ini_set('implicit_flush', 1);
for ($i =…
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…
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…
ob_start() doesn't seem to be stopping any output so when I flush the buffer it's doubling up
";
echo ob_get_flush();
?>
Outputs
Text.....
Text.....
But I was expecting
Text.....
Any ideas ?
Thanks