summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-12-04 10:47:26 +0100
committerAndrey Andreev <narf@devilix.net>2014-12-04 10:47:26 +0100
commit309d7012a737f140076cabbe8873dc39f25331b2 (patch)
treee9daa4922715528b654e16433fa85578941cba07 /system
parenta94c397768c5906e0e519dc5b473d0688048caaa (diff)
Zip library changes related to PR #3341
- Drop compression_encoding option, it requires PHP 5.4. - Change default compression_level to 2 as this was previously the hard-coded default. - Improve on the doc changes made in the PR.
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Zip.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 5208c9149..2f6ab8b68 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -95,19 +95,15 @@ class CI_Zip {
* @var int
*/
public $now;
-
- /**
- * The level of compression. 0 to 9, 9 being the highest level of
- * compression.
- * @var int
- */
- public $compression_level = 6;
-
- /**
- * Which encoding to use. One of the ZLIB_ENCODING_* constants.
- * @var int
- */
- public $compression_encoding = ZLIB_ENCODING_DEFLATE;
+
+ /**
+ * The level of compression
+ *
+ * Ranges from 0 to 9, with 9 being the highest level.
+ *
+ * @var int
+ */
+ public $compression_level = 2;
/**
* Initialize zip compression class
@@ -261,7 +257,7 @@ class CI_Zip {
$uncompressed_size = strlen($data);
$crc32 = crc32($data);
- $gzdata = substr(gzcompress($data, $this->compression_level, $this->compression_encoding), 2, -4);
+ $gzdata = substr(gzcompress($data, $this->compression_level), 2, -4);
$compressed_size = strlen($gzdata);
$this->zipdata .=