From d059ba9bb09b872361eee77c46cbd4aba0042e83 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 2 Apr 2010 11:34:38 +0200 Subject: Fix gzip compression in combination with buffer flushing FS#1927 This introduces a new function called tpl_flush() which should be used by template authors in favor of the PHP flush() method. --- inc/template.php | 13 +++++++++++++ lib/tpl/default/main.php | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/inc/template.php b/inc/template.php index 7b0ef466b..3eda2f4af 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1407,5 +1407,18 @@ function tpl_subscribe() { echo ''; } +/** + * Tries to send already created content right to the browser + * + * Wraps around ob_flush() and flush() + * + * @author Andreas Gohr + */ +function tpl_flush(){ + ob_flush(); + flush(); +} + + //Setup VIM: ex: et ts=4 enc=utf-8 : diff --git a/lib/tpl/default/main.php b/lib/tpl/default/main.php index b5717c009..d9231678b 100644 --- a/lib/tpl/default/main.php +++ b/lib/tpl/default/main.php @@ -82,7 +82,7 @@ if (!defined('DOKU_INC')) die(); - + @@ -94,7 +94,7 @@ if (!defined('DOKU_INC')) die();
 
- +
-- cgit v1.2.3