note 68527 deleted from function.register-shutdown-function by bjori
| From: | bjori@php.net | Date: | Tue, 01 Aug 2006 09:01:54 +0000 |
| Subject: | note 68527 deleted from function.register-shutdown-function by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-115397@lists.php.net to get a copy of this message | ||
Note Submitter: patrick at hexane dot org
Reason: in docs
----
If you were depending on output buffering to be completed in your shutdown function, you can close
the output buffers down yourself:
function grab_page_content($content) {
global $page;
$page['content'] = $content;
return '';
}
function render_page() {
global $page;
while(in_array('grab_page_content', ob_list_handlers())) {
ob_end_flush();
}
if ($page['template'])
require_once($page['template']);
}
ob_start("grab_page_content");
register_shutdown_function( "render_page" );
This technique is tested on 4.4.2, 5.0.4, and 5.1.4.