From 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:45:02 +0100 Subject: initial checking of customized version 1.0rc9 --- .../adodb-php/session/adodb-compress-bzip2.php | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 vendor/adodb/adodb-php/session/adodb-compress-bzip2.php (limited to 'vendor/adodb/adodb-php/session/adodb-compress-bzip2.php') diff --git a/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php b/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php new file mode 100644 index 0000000..5b2458d --- /dev/null +++ b/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php @@ -0,0 +1,118 @@ +_block_size; + } + + /** + */ + function setBlockSize($block_size) { + assert('$block_size >= 1'); + assert('$block_size <= 9'); + $this->_block_size = (int) $block_size; + } + + /** + */ + function getWorkLevel() { + return $this->_work_level; + } + + /** + */ + function setWorkLevel($work_level) { + assert('$work_level >= 0'); + assert('$work_level <= 250'); + $this->_work_level = (int) $work_level; + } + + /** + */ + function getMinLength() { + return $this->_min_length; + } + + /** + */ + function setMinLength($min_length) { + assert('$min_length >= 0'); + $this->_min_length = (int) $min_length; + } + + /** + */ + function __construct($block_size = null, $work_level = null, $min_length = null) { + if (!is_null($block_size)) { + $this->setBlockSize($block_size); + } + + if (!is_null($work_level)) { + $this->setWorkLevel($work_level); + } + + if (!is_null($min_length)) { + $this->setMinLength($min_length); + } + } + + /** + */ + function write($data, $key) { + if (strlen($data) < $this->_min_length) { + return $data; + } + + if (!is_null($this->_block_size)) { + if (!is_null($this->_work_level)) { + return bzcompress($data, $this->_block_size, $this->_work_level); + } else { + return bzcompress($data, $this->_block_size); + } + } + + return bzcompress($data); + } + + /** + */ + function read($data, $key) { + return $data ? bzdecompress($data) : $data; + } + +} + +return 1; -- cgit v1.2.3-54-g00ecf