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-gzip.php | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 vendor/adodb/adodb-php/session/adodb-compress-gzip.php (limited to 'vendor/adodb/adodb-php/session/adodb-compress-gzip.php') diff --git a/vendor/adodb/adodb-php/session/adodb-compress-gzip.php b/vendor/adodb/adodb-php/session/adodb-compress-gzip.php new file mode 100644 index 0000000..40e906a --- /dev/null +++ b/vendor/adodb/adodb-php/session/adodb-compress-gzip.php @@ -0,0 +1,93 @@ +_level; + } + + /** + */ + function setLevel($level) { + assert('$level >= 0'); + assert('$level <= 9'); + $this->_level = (int) $level; + } + + /** + */ + function getMinLength() { + return $this->_min_length; + } + + /** + */ + function setMinLength($min_length) { + assert('$min_length >= 0'); + $this->_min_length = (int) $min_length; + } + + /** + */ + function __construct($level = null, $min_length = null) { + if (!is_null($level)) { + $this->setLevel($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->_level)) { + return gzcompress($data, $this->_level); + } else { + return gzcompress($data); + } + } + + /** + */ + function read($data, $key) { + return $data ? gzuncompress($data) : $data; + } + +} + +return 1; -- cgit v1.2.3-54-g00ecf