summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/php_zip.h')
-rw-r--r--ext/zip/php_zip.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h
index 6712b5291..6891d031f 100644
--- a/ext/zip/php_zip.h
+++ b/ext/zip/php_zip.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_zip.h,v 1.10.2.5 2008/01/18 00:51:38 pajoye Exp $ */
+/* $Id: php_zip.h,v 1.10.2.9 2009/02/05 19:53:22 pajoye Exp $ */
#ifndef PHP_ZIP_H
#define PHP_ZIP_H
@@ -24,14 +24,23 @@
extern zend_module_entry zip_module_entry;
#define phpext_zip_ptr &zip_module_entry
-#ifdef ZTS
#include "TSRM.h"
-#endif
#include "lib/zip.h"
#define PHP_ZIP_VERSION_STRING "1.8.11"
+#if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6)
+# define PHP_ZIP_USE_OO 1
+#endif
+
+#ifndef Z_SET_REFCOUNT_P
+# if PHP_MAJOR_VERSION < 6 && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)
+# define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc
+# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0
+# endif
+#endif
+
/* {{{ OPENBASEDIR_CHECKPATH(filename) */
#if (PHP_MAJOR_VERSION < 6)
#define OPENBASEDIR_CHECKPATH(filename) \
@@ -55,6 +64,7 @@ typedef struct _ze_zip_read_rsrc {
struct zip_stat sb;
} zip_read_rsrc;
+#ifdef PHP_ZIP_USE_OO
#define ZIPARCHIVE_ME(name, arg_info, flags) ZEND_FENTRY(name, c_ziparchive_ ##name, arg_info, flags)
#define ZIPARCHIVE_METHOD(name) ZEND_NAMED_FUNCTION(c_ziparchive_##name)
@@ -73,6 +83,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, char *path, char
php_stream *php_stream_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC);
extern php_stream_wrapper php_stream_zip_wrapper;
+#endif
#endif /* PHP_ZIP_H */