summaryrefslogtreecommitdiff
path: root/inc/compatibility.php
diff options
context:
space:
mode:
authorGerry Weißbach <gerry.w@gammaproduction.de>2014-12-22 10:31:30 +0100
committerGerry Weißbach <gerry.w@gammaproduction.de>2014-12-22 10:31:30 +0100
commit8da2ebf4f4261eb8f54df5704b5d9af283b5402d (patch)
tree9c63975e3898c949e1784e30e81a5ed3da7fca93 /inc/compatibility.php
parent5e7f4d50cbbc788c9c0483a0a2ff1b536e4ffe8c (diff)
parent1bf4abb07f65e28578bae98aad457cb768d8b44f (diff)
downloadrpg-8da2ebf4f4261eb8f54df5704b5d9af283b5402d.tar.gz
rpg-8da2ebf4f4261eb8f54df5704b5d9af283b5402d.tar.bz2
Merge remote-tracking branch 'splitbrain/master'
Diffstat (limited to 'inc/compatibility.php')
-rw-r--r--inc/compatibility.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/inc/compatibility.php b/inc/compatibility.php
index ae780e5ac..cb865a2d7 100644
--- a/inc/compatibility.php
+++ b/inc/compatibility.php
@@ -33,4 +33,50 @@ if(!function_exists('ctype_digit')) {
if(preg_match('/^\d+$/', $text)) return true;
return false;
}
+}
+
+if(!function_exists('gzopen') && function_exists('gzopen64')) {
+ /**
+ * work around for PHP compiled against certain zlib versions #865
+ *
+ * @link http://stackoverflow.com/questions/23417519/php-zlib-gzopen-not-exists
+ *
+ * @param string $filename
+ * @param string $mode
+ * @param int $use_include_path
+ * @return mixed
+ */
+ function gzopen($filename, $mode, $use_include_path = 0) {
+ return gzopen64($filename, $mode, $use_include_path);
+ }
+}
+
+if(!function_exists('gzseek') && function_exists('gzseek64')) {
+ /**
+ * work around for PHP compiled against certain zlib versions #865
+ *
+ * @link http://stackoverflow.com/questions/23417519/php-zlib-gzopen-not-exists
+ *
+ * @param resource $zp
+ * @param int $offset
+ * @param int $whence
+ * @return int
+ */
+ function gzseek($zp, $offset, $whence = SEEK_SET) {
+ return gzseek64($zp, $offset, $whence);
+ }
+}
+
+if(!function_exists('gztell') && function_exists('gztell64')) {
+ /**
+ * work around for PHP compiled against certain zlib versions #865
+ *
+ * @link http://stackoverflow.com/questions/23417519/php-zlib-gzopen-not-exists
+ *
+ * @param resource $zp
+ * @return int
+ */
+ function gztell($zp) {
+ return gztell64($zp);
+ }
} \ No newline at end of file