diff options
author | Andrey Andreev <narf@devilix.net> | 2015-01-12 16:23:26 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-01-12 16:23:26 +0100 |
commit | 45a8afaabc6d09ad59bbb3c89a6cdfe8cbc3312c (patch) | |
tree | 7ca4207099f9225b5ef74b31f48627a282e7fdf2 /system/libraries/Zip.php | |
parent | cd94dd7e1d8969658810ccc4158a75d2936d0a44 (diff) | |
parent | 934d6d9797f4dadd4e4d05b12bc4d7309fedb6c3 (diff) |
Merge branch 'develop' into feature/session
Diffstat (limited to 'system/libraries/Zip.php')
-rw-r--r-- | system/libraries/Zip.php | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 434229471..cee5d8d76 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.2.4 or newer + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014, British Columbia Institute of Technology + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 @@ -59,35 +59,35 @@ class CI_Zip { * * @var string */ - public $zipdata = ''; + public $zipdata = ''; /** * Zip data for a directory in string form * * @var string */ - public $directory = ''; + public $directory = ''; /** * Number of files/folder in zip file * * @var int */ - public $entries = 0; + public $entries = 0; /** * Number of files in zip * * @var int */ - public $file_num = 0; + public $file_num = 0; /** * relative offset of local header * * @var int */ - public $offset = 0; + public $offset = 0; /** * Reference to time at init @@ -97,6 +97,15 @@ class CI_Zip { public $now; /** + * 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 * * @return void @@ -248,7 +257,7 @@ class CI_Zip { $uncompressed_size = strlen($data); $crc32 = crc32($data); - $gzdata = substr(gzcompress($data), 2, -4); + $gzdata = substr(gzcompress($data, $this->compression_level), 2, -4); $compressed_size = strlen($gzdata); $this->zipdata .= @@ -464,11 +473,11 @@ class CI_Zip { */ public function clear_data() { - $this->zipdata = ''; - $this->directory = ''; - $this->entries = 0; - $this->file_num = 0; - $this->offset = 0; + $this->zipdata = ''; + $this->directory = ''; + $this->entries = 0; + $this->file_num = 0; + $this->offset = 0; return $this; } |