summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authormarcel <marcel@rucksackreinigung.de>2006-08-23 23:11:49 +0200
committermarcel <marcel@rucksackreinigung.de>2006-08-23 23:11:49 +0200
commitff3ed99f17e6204cc4f6331830c53a084f385d9a (patch)
tree270560469411e93e397f0d64dfafe1a09a7d61e4 /inc/pageutils.php
parent95a12943a8ef44b4c16f72c9c1c7f5e28b1d60c4 (diff)
downloadrpg-ff3ed99f17e6204cc4f6331830c53a084f385d9a.tar.gz
rpg-ff3ed99f17e6204cc4f6331830c53a084f385d9a.tar.bz2
Added bz2 compression support for Attic
darcs-hash:20060823211149-9c1ae-569f295c33dc798a429a373f48cb09122334ea29.gz
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php13
1 files changed, 10 insertions, 3 deletions
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;