summaryrefslogtreecommitdiff
path: root/inc/compatibility.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-10-14 21:04:54 +0200
committerAndreas Gohr <andi@splitbrain.org>2014-10-14 21:04:54 +0200
commit8457f8cee42b57b7f708f23cbbfc50b1939de30d (patch)
treefa562ee2dd11aa46850092c9e2611a4ba1ce7566 /inc/compatibility.php
parent37b21a1b15c01de8390be3af74d1cf08f4676313 (diff)
downloadrpg-8457f8cee42b57b7f708f23cbbfc50b1939de30d.tar.gz
rpg-8457f8cee42b57b7f708f23cbbfc50b1939de30d.tar.bz2
another fix for broken gzlib linking #865
Diffstat (limited to 'inc/compatibility.php')
-rw-r--r--inc/compatibility.php36
1 files changed, 33 insertions, 3 deletions
diff --git a/inc/compatibility.php b/inc/compatibility.php
index 2738c9bb1..cb865a2d7 100644
--- a/inc/compatibility.php
+++ b/inc/compatibility.php
@@ -41,12 +41,42 @@ if(!function_exists('gzopen') && function_exists('gzopen64')) {
*
* @link http://stackoverflow.com/questions/23417519/php-zlib-gzopen-not-exists
*
- * @param string $filename
- * @param string $mode
- * @param int $use_include_path
+ * @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