From 501252a5b9cc519c5b82ee6eadc26f6b2206fbab Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Fri, 25 Aug 2006 16:47:39 +0200
Subject: [PATCH] compression fallback

This updates the availability check of the choosen compression method. If bzip2
is configured but not available it falls back to gzip if available.

darcs-hash:20060825144739-7ad00-9f7ce54fd1dbf0d7a8272393e9bc02d862b28fff.gz
---
 inc/init.php | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/inc/init.php b/inc/init.php
index 783d3d9c4..b6fdc0e73 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -94,8 +94,11 @@
   @ini_set('magic_quotes_sybase',0);
 
   // disable gzip if not available
-  if($conf['usegzip'] && !function_exists('gzopen')){
-    $conf['usegzip'] = 0;
+  if($conf['compression'] == 'bzip2' && !function_exists('bzopen')){
+    $conf['compression'] = 'gzip';
+  }
+  if($conf['compression'] == 'gzip' && !function_exists('gzopen')){
+    $conf['compression'] = 0;
   }
 
   // precalculate file creation modes
-- 
GitLab