summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-05-19 23:27:51 +0200
committerAndreas Gohr <andi@splitbrain.org>2006-05-19 23:27:51 +0200
commit3138b5c7607b434fa9b1b8c563ad461985d5b5c8 (patch)
treefafd6d4ad070b853bfd9205af32cc7433f192226
parent64c9cfd50fc230a56c886d1c45d84a4f98dcc4c7 (diff)
downloadrpg-3138b5c7607b434fa9b1b8c563ad461985d5b5c8.tar.gz
rpg-3138b5c7607b434fa9b1b8c563ad461985d5b5c8.tar.bz2
moved gzip compression to init.php
darcs-hash:20060519212751-7ad00-ace54b61706fdf4f1b7c2abdbabee215a1e256ab.gz
-rw-r--r--inc/init.php8
-rw-r--r--inc/template.php4
-rw-r--r--lib/exe/fetch.php1
3 files changed, 9 insertions, 4 deletions
diff --git a/inc/init.php b/inc/init.php
index 00d6a6a90..4289e30a9 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -60,6 +60,14 @@
// make session rewrites XHTML compliant
@ini_set('arg_separator.output', '&amp;');
+ // enable gzip compression
+ if ($conf['gzip_output'] &&
+ !defined('DOKU_DISABLE_GZIP_OUTPUT') &&
+ function_exists('ob_gzhandler') &&
+ preg_match('/gzip|deflate/', $_SERVER['HTTP_ACCEPT_ENCODING'])) {
+ ob_start('ob_gzhandler');
+ }
+
// init session
if (!headers_sent() && !defined('NOSESSION')){
session_name("DokuWiki");
diff --git a/inc/template.php b/inc/template.php
index 7a7e751a9..e79b312db 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -19,10 +19,6 @@
function template($tpl){
global $conf;
- if ($conf['gzip_output'] && extension_loaded('zlib') && preg_match('/gzip|deflate/', $_SERVER['HTTP_ACCEPT_ENCODING'])) {
- ob_start('ob_gzhandler');
- }
-
if(@is_readable(DOKU_INC.'lib/tpl/'.$conf['template'].'/'.$tpl))
return DOKU_INC.'lib/tpl/'.$conf['template'].'/'.$tpl;
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php
index 7f5024b2d..f1cf9c7b4 100644
--- a/lib/exe/fetch.php
+++ b/lib/exe/fetch.php
@@ -7,6 +7,7 @@
*/
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
+ define('DOKU_DISABLE_GZIP_OUTPUT', 1);
require_once(DOKU_INC.'inc/init.php');
require_once(DOKU_INC.'inc/common.php');
require_once(DOKU_INC.'inc/pageutils.php');