From ff3ed99f17e6204cc4f6331830c53a084f385d9a Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 23 Aug 2006 23:11:49 +0200 Subject: Added bz2 compression support for Attic darcs-hash:20060823211149-9c1ae-569f295c33dc798a429a373f48cb09122334ea29.gz --- inc/pageutils.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index aacee1b13..2055cf2cc 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -148,9 +148,16 @@ function wikiFN($id,$rev=''){ $fn = $conf['datadir'].'/'.utf8_encodeFN($id).'.txt'; }else{ $fn = $conf['olddir'].'/'.utf8_encodeFN($id).'.'.$rev.'.txt'; - if($conf['usegzip'] && !@file_exists($fn)){ - //return gzip if enabled and plaintext doesn't exist - $fn .= '.gz'; + if($conf['compression']){ + //test for extensions here, we want to read both compressions + if (file_exists($fn . '.gz')){ + $fn .= '.gz'; + }else if(file_exists($fn . '.bz2')){ + $fn .= '.bz2'; + }else{ + //file doesnt exist yet, so we take the configured extension + $fn .= '.' . $conf['compression']; + } } } return $fn; -- cgit v1.2.3