196963
diff -up php-5.4.15/ext/zip/config.m4.systzip php-5.4.15/ext/zip/config.m4
196963
--- php-5.4.15/ext/zip/config.m4.systzip	2013-05-08 07:41:20.000000000 +0200
196963
+++ php-5.4.15/ext/zip/config.m4	2013-05-09 06:46:26.084673644 +0200
196963
@@ -13,65 +13,116 @@ fi
196963
 PHP_ARG_WITH(pcre-dir, pcre install prefix,
196963
 [  --with-pcre-dir           ZIP: pcre install prefix], no, no)
196963
 
196963
+PHP_ARG_WITH(libzip, libzip,
196963
+[ --with-libzip[=DIR]        ZIP: use libzip], no, no)
196963
+
196963
 if test "$PHP_ZIP" != "no"; then
196963
+  if test "$PHP_LIBZIP" != "no"; then
196963
+
196963
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
196963
+
196963
+    dnl system libzip, depends on libzip
196963
+    AC_MSG_CHECKING(for libzip)
196963
+    if test -r $PHP_LIBZIP/include/zip.h; then
196963
+      LIBZIP_CFLAGS="-I$PHP_LIBZIP/include"
196963
+      LIBZIP_LIBDIR="$PHP_LIBZIP/$PHP_LIBDIR"
196963
+      AC_MSG_RESULT(from option: found in $PHP_LIBZIP)
196963
+
196963
+    elif test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libzip; then
196963
+      LIBZIP_CFLAGS=`$PKG_CONFIG libzip --cflags`
196963
+      LIBZIP_LIBDIR=`$PKG_CONFIG libzip --variable=libdir`
196963
+      AC_MSG_RESULT(from pkgconfig: found in $LIBZIP_LIBDIR)
196963
 
196963
-  if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
196963
-    if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
196963
-      PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
196963
-      PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
196963
-    elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
196963
-      PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
196963
-      PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
196963
     else
196963
-      AC_MSG_ERROR([Can not find zlib headers under "$PHP_ZLIB_DIR"])
196963
+      for i in /usr/local /usr; do
196963
+        if test -r $i/include/zip.h; then
196963
+          LIBZIP_CFLAGS="-I$i/include"
196963
+          LIBZIP_LIBDIR="$i/$PHP_LIBDIR"
196963
+          AC_MSG_RESULT(in default path: found in $i)
196963
+          break
196963
+        fi
196963
+      done
196963
     fi
196963
+
196963
+    if test -z "$LIBZIP_LIBDIR"; then
196963
+      AC_MSG_RESULT(not found)
196963
+      AC_MSG_ERROR(Please reinstall the libzip distribution)
196963
+    fi
196963
+
196963
+    dnl Could not think of a simple way to check libzip for overwrite support
196963
+    PHP_CHECK_LIBRARY(zip, zip_open,
196963
+    [
196963
+      PHP_ADD_LIBRARY_WITH_PATH(zip, $LIBZIP_LIBDIR, ZIP_SHARED_LIBADD)
196963
+      AC_DEFINE(HAVE_LIBZIP,1,[ ])
196963
+    ], [
196963
+      AC_MSG_ERROR(could not find usable libzip)
196963
+    ], [
196963
+      -L$LIBZIP_LIBDIR
196963
+    ])
196963
+
196963
+    AC_DEFINE(HAVE_ZIP,1,[ ]) 
196963
+    PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared,, $LIBZIP_CFLAGS)
196963
+    PHP_SUBST(ZIP_SHARED_LIBADD)
196963
   else
196963
-    for i in /usr/local /usr; do
196963
-      if test -f "$i/include/zlib/zlib.h"; then
196963
-        PHP_ZLIB_DIR="$i"
196963
-        PHP_ZLIB_INCDIR="$i/include/zlib"
196963
-      elif test -f "$i/include/zlib.h"; then
196963
-        PHP_ZLIB_DIR="$i"
196963
-        PHP_ZLIB_INCDIR="$i/include"
196963
+
196963
+  dnl bundled libzip, depends on zlib
196963
+    if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
196963
+      if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
196963
+        PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
196963
+        PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
196963
+      elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
196963
+        PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
196963
+        PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
196963
+      else
196963
+        AC_MSG_ERROR([Can not find zlib headers under "$PHP_ZLIB_DIR"])
196963
       fi
196963
-    done
196963
-  fi
196963
+    else
196963
+      for i in /usr/local /usr; do
196963
+        if test -f "$i/include/zlib/zlib.h"; then
196963
+          PHP_ZLIB_DIR="$i"
196963
+          PHP_ZLIB_INCDIR="$i/include/zlib"
196963
+        elif test -f "$i/include/zlib.h"; then
196963
+          PHP_ZLIB_DIR="$i"
196963
+          PHP_ZLIB_INCDIR="$i/include"
196963
+        fi
196963
+      done
196963
+    fi
196963
 
196963
-  dnl # zlib
196963
-  AC_MSG_CHECKING([for the location of zlib])
196963
-  if test "$PHP_ZLIB_DIR" = "no"; then
196963
-    AC_MSG_ERROR([zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located])
196963
-  else
196963
-    AC_MSG_RESULT([$PHP_ZLIB_DIR])
196963
-    PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD)
196963
-    PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR)
196963
-  fi
196963
+    dnl # zlib
196963
+    AC_MSG_CHECKING([for the location of zlib])
196963
+    if test "$PHP_ZLIB_DIR" = "no"; then
196963
+      AC_MSG_ERROR([zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located])
196963
+    else
196963
+      AC_MSG_RESULT([$PHP_ZLIB_DIR])
196963
+      PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD)
196963
+      PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR)
196963
+    fi
196963
 
196963
-  dnl This is PECL build, check if bundled PCRE library is used
196963
-  old_CPPFLAGS=$CPPFLAGS
196963
-  CPPFLAGS=$INCLUDES
196963
-  AC_EGREP_CPP(yes,[
196963
+    dnl This is PECL build, check if bundled PCRE library is used
196963
+    old_CPPFLAGS=$CPPFLAGS
196963
+    CPPFLAGS=$INCLUDES
196963
+    AC_EGREP_CPP(yes,[
196963
 #include <main/php_config.h>
196963
 #if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
196963
 yes
196963
 #endif
196963
-  ],[
196963
-    PHP_PCRE_REGEX=yes
196963
-  ],[
196963
-    AC_EGREP_CPP(yes,[
196963
+    ],[
196963
+      PHP_PCRE_REGEX=yes
196963
+    ],[
196963
+      AC_EGREP_CPP(yes,[
196963
 #include <main/php_config.h>
196963
 #if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
196963
 yes
196963
 #endif
196963
-    ],[
196963
-      PHP_PCRE_REGEX=pecl
196963
-    ],[
196963
-      PHP_PCRE_REGEX=no
196963
+      ],[
196963
+        PHP_PCRE_REGEX=pecl
196963
+      ],[
196963
+        PHP_PCRE_REGEX=no
196963
+      ])
196963
     ])
196963
-  ])
196963
-  CPPFLAGS=$old_CPPFLAGS
196963
+    CPPFLAGS=$old_CPPFLAGS
196963
 
196963
-  PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
196963
+    PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
196963
                          lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c  \
196963
                          lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \
196963
                          lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \
196963
@@ -98,10 +149,11 @@ yes
196963
 						 lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \
196963
 						 lib/zip_source_read.c lib/zip_source_stat.c"
196963
 
196963
-  AC_DEFINE(HAVE_ZIP,1,[ ])
196963
-  PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
196963
-  PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
196963
-  PHP_SUBST(ZIP_SHARED_LIBADD)
196963
+    AC_DEFINE(HAVE_ZIP,1,[ ])
196963
+    PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
196963
+    PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
196963
+    PHP_SUBST(ZIP_SHARED_LIBADD)
196963
+  fi
196963
 
196963
   dnl so we always include the known-good working hack.
196963
   PHP_ADD_MAKEFILE_FRAGMENT
196963
diff -up php-5.4.15/ext/zip/php_zip.c.systzip php-5.4.15/ext/zip/php_zip.c
196963
--- php-5.4.15/ext/zip/php_zip.c.systzip	2013-05-08 07:41:20.000000000 +0200
196963
+++ php-5.4.15/ext/zip/php_zip.c	2013-05-09 06:50:33.286058049 +0200
196963
@@ -30,8 +30,232 @@
196963
 #include "ext/pcre/php_pcre.h"
196963
 #include "ext/standard/php_filestat.h"
196963
 #include "php_zip.h"
196963
+#if defined(HAVE_LIBZIP)
196963
+#include <zip.h>
196963
+
196963
+/* Copied from libzip 0.10 */
196963
+
196963
+/* state of change of a file in zip archive */
196963
+
196963
+enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED,
196963
+                 ZIP_ST_ADDED, ZIP_ST_RENAMED };
196963
+
196963
+/* error source for layered sources */
196963
+
196963
+enum zip_les { ZIP_LES_NONE, ZIP_LES_UPPER, ZIP_LES_LOWER, ZIP_LES_INVAL };
196963
+
196963
+typedef zip_int64_t (*zip_source_layered_callback)(struct zip_source *, void *,
196963
+                                                   void *, zip_uint64_t,
196963
+                                                   enum zip_source_cmd);
196963
+
196963
+struct zip_error {
196963
+    int zip_err;        /* libzip error code (ZIP_ER_*) */
196963
+    int sys_err;        /* copy of errno (E*) or zlib error code */
196963
+    char *str;          /* string representation or NULL */
196963
+};
196963
+
196963
+/* zip archive, part of API */
196963
+
196963
+struct zip {
196963
+    char *zn;                   /* file name */
196963
+    FILE *zp;                   /* file */
196963
+    struct zip_error error;     /* error information */
196963
+
196963
+    unsigned int flags;         /* archive global flags */
196963
+    unsigned int ch_flags;	/* changed archive global flags */
196963
+
196963
+    char *default_password;     /* password used when no other supplied */
196963
+
196963
+    struct zip_cdir *cdir;	/* central directory */
196963
+    char *ch_comment;           /* changed archive comment */
196963
+    int ch_comment_len;         /* length of changed zip archive
196963
+                                 * comment, -1 if unchanged */
196963
+    zip_uint64_t nentry;        /* number of entries */
196963
+    zip_uint64_t nentry_alloc;  /* number of entries allocated */
196963
+    struct zip_entry *entry;    /* entries */
196963
+    int nfile;                  /* number of opened files within archive */
196963
+    int nfile_alloc;            /* number of files allocated */
196963
+    struct zip_file **file;     /* opened files within archive */
196963
+};
196963
+
196963
+/* file in zip archive, part of API */
196963
+
196963
+struct zip_file {
196963
+    struct zip *za;             /* zip archive containing this file */
196963
+    struct zip_error error;     /* error information */
196963
+    int eof;
196963
+    struct zip_source *src;     /* data source */
196963
+};
196963
+
196963
+/* zip archive directory entry (central or local) */
196963
+
196963
+struct zip_dirent {
196963
+    unsigned short version_madeby;	/* (c)  version of creator */
196963
+    unsigned short version_needed;	/* (cl) version needed to extract */
196963
+    unsigned short bitflags;            /* (cl) general purpose bit flag */
196963
+    unsigned short comp_method;         /* (cl) compression method used */
196963
+    time_t last_mod;                    /* (cl) time of last modification */
196963
+    unsigned int crc;                   /* (cl) CRC-32 of uncompressed data */
196963
+    unsigned int comp_size;             /* (cl) size of commpressed data */
196963
+    unsigned int uncomp_size;           /* (cl) size of uncommpressed data */
196963
+    char *filename;                     /* (cl) file name (NUL-terminated) */
196963
+    unsigned short filename_len;        /* (cl) length of filename (w/o NUL) */
196963
+    char *extrafield;                   /* (cl) extra field */
196963
+    unsigned short extrafield_len;	/* (cl) length of extra field */
196963
+    char *comment;                      /* (c)  file comment */
196963
+    unsigned short comment_len;         /* (c)  length of file comment */
196963
+    unsigned short disk_number;         /* (c)  disk number start */
196963
+    unsigned short int_attrib;          /* (c)  internal file attributes */
196963
+    unsigned int ext_attrib;            /* (c)  external file attributes */
196963
+    unsigned int offset;                /* (c)  offset of local header  */
196963
+};
196963
+
196963
+/* zip archive central directory */
196963
+
196963
+struct zip_cdir {
196963
+    struct zip_dirent *entry;   /* directory entries */
196963
+    int nentry;                 /* number of entries */
196963
+
196963
+    unsigned int size;          /* size of central direcotry */
196963
+    unsigned int offset;        /* offset of central directory in file */
196963
+    char *comment;              /* zip archive comment */
196963
+    unsigned short comment_len; /* length of zip archive comment */
196963
+};
196963
+
196963
+struct zip_source {
196963
+    struct zip_source *src;
196963
+    union {
196963
+	zip_source_callback f;
196963
+        zip_source_layered_callback l;
196963
+    } cb;
196963
+    void *ud;
196963
+    enum zip_les error_source;
196963
+    int is_open;
196963
+};
196963
+
196963
+/* entry in zip archive directory */
196963
+
196963
+struct zip_entry {
196963
+    enum zip_state state;
196963
+    struct zip_source *source;
196963
+    char *ch_filename;
196963
+    char *ch_extra;
196963
+    int ch_extra_len;
196963
+    char *ch_comment;
196963
+    int ch_comment_len;
196963
+};
196963
+
196963
+void _zip_dirent_finalize(struct zip_dirent *zde)
196963
+{
196963
+    free(zde->filename);
196963
+    zde->filename = NULL;
196963
+    free(zde->extrafield);
196963
+    zde->extrafield = NULL;
196963
+    free(zde->comment);
196963
+    zde->comment = NULL;
196963
+}
196963
+
196963
+void _zip_cdir_free(struct zip_cdir *cd)
196963
+{
196963
+    int i;
196963
+
196963
+    if (!cd)
196963
+        return;
196963
+
196963
+    for (i=0; i<cd->nentry; i++)
196963
+        _zip_dirent_finalize(cd->entry+i);
196963
+    free(cd->comment);
196963
+    free(cd->entry);
196963
+    free(cd);
196963
+}
196963
+
196963
+void _zip_error_fini(struct zip_error *err)
196963
+{
196963
+    free(err->str);
196963
+    err->str = NULL;
196963
+}
196963
+
196963
+void _zip_error_init(struct zip_error *err)
196963
+{
196963
+    err->zip_err = ZIP_ER_OK;
196963
+    err->sys_err = 0;
196963
+    err->str = NULL;
196963
+}
196963
+
196963
+void _zip_unchange_data(struct zip_entry *ze)
196963
+{
196963
+    if (ze->source) {
196963
+        zip_source_free(ze->source);
196963
+        ze->source = NULL;
196963
+    }
196963
+
196963
+    ze->state = ze->ch_filename ? ZIP_ST_RENAMED : ZIP_ST_UNCHANGED;
196963
+}
196963
+
196963
+void _zip_entry_free(struct zip_entry *ze)
196963
+{
196963
+    free(ze->ch_filename);
196963
+    ze->ch_filename = NULL;
196963
+    free(ze->ch_extra);
196963
+    ze->ch_extra = NULL;
196963
+    ze->ch_extra_len = -1;
196963
+    free(ze->ch_comment);
196963
+    ze->ch_comment = NULL;
196963
+    ze->ch_comment_len = -1;
196963
+
196963
+    _zip_unchange_data(ze);
196963
+}
196963
+
196963
+void
196963
+_zip_error_set(struct zip_error *err, int ze, int se)
196963
+{
196963
+    if (err) {
196963
+	err->zip_err = ze;
196963
+        err->sys_err = se;
196963
+    }
196963
+}
196963
+
196963
+void _zip_free(struct zip *za)
196963
+{
196963
+    int i;
196963
+
196963
+    if (za == NULL)
196963
+        return;
196963
+
196963
+    if (za->zn)
196963
+        free(za->zn);
196963
+
196963
+    if (za->zp)
196963
+       	fclose(za->zp);
196963
+
196963
+    free(za->default_password);
196963
+    _zip_cdir_free(za->cdir);
196963
+    free(za->ch_comment);
196963
+
196963
+    if (za->entry) {
196963
+        for (i=0; i<za->nentry; i++) {
196963
+            _zip_entry_free(za->entry+i);
196963
+        }
196963
+        free(za->entry);
196963
+    }
196963
+
196963
+    for (i=0; i<za->nfile; i++) {
196963
+        if (za->file[i]->error.zip_err == ZIP_ER_OK) {
196963
+            _zip_error_set(&za->file[i]->error, ZIP_ER_ZIPCLOSED, 0);
196963
+            za->file[i]->za = NULL;
196963
+        }
196963
+    }
196963
+
196963
+    free(za->file);
196963
+    free(za);
196963
+    return;
196963
+} 
196963
+
196963
+
196963
+#else
196963
 #include "lib/zip.h"
196963
 #include "lib/zipint.h"
196963
+#endif
196963
 
196963
 /* zip_open is a macro for renaming libzip zipopen, so we need to use PHP_NAMED_FUNCTION */
196963
 static PHP_NAMED_FUNCTION(zif_zip_open);
196963
@@ -1631,6 +1855,10 @@ static ZIPARCHIVE_METHOD(addEmptyDir)
196963
 	}
196963
 
196963
 	idx = zip_stat(intern, s, 0, &sb);
196963
+	/* We don't care about the NOENT status	error here. */
196963
+	if (intern->error.zip_err == ZIP_ER_NOENT) {
196963
+		_zip_error_set(&intern->error, ZIP_ER_OK, 0);
196963
+	}
196963
 	if (idx >= 0) {
196963
 		RETVAL_FALSE;
196963
 	} else {
196963
@@ -1853,6 +2081,10 @@ static ZIPARCHIVE_METHOD(addFromString)
196963
 	}
196963
 
196963
 	cur_idx = zip_name_locate(intern, (const char *)name, 0);
196963
+	/* We don't care about the NOENT status error here. */
196963
+	if (intern->error.zip_err == ZIP_ER_NOENT) {
196963
+		_zip_error_set(&intern->error, ZIP_ER_OK, 0);
196963
+	}
196963
 	/* TODO: fix  _zip_replace */
196963
 	if (cur_idx >= 0) {
196963
 		if (zip_delete(intern, cur_idx) == -1) {
196963
@@ -2877,5 +3109,9 @@ static PHP_MINFO_FUNCTION(zip)
196963
 	php_info_print_table_row(2, "Zip version", PHP_ZIP_VERSION_STRING);
196963
-	php_info_print_table_row(2, "Libzip version", LIBZIP_VERSION);
196963
+#if defined(HAVE_LIBZIP)
196963
+	php_info_print_table_row(2, "Compiled against libzip version", LIBZIP_VERSION);
196963
+#else
196963
+	php_info_print_table_row(2, "Bundled libzip version", LIBZIP_VERSION);
196963
+#endif
196963
 
196963
 	php_info_print_table_end();
196963
 }
196963
diff -up php-5.4.15/ext/zip/php_zip.h.systzip php-5.4.15/ext/zip/php_zip.h
196963
--- php-5.4.15/ext/zip/php_zip.h.systzip	2013-05-08 07:41:20.000000000 +0200
196963
+++ php-5.4.15/ext/zip/php_zip.h	2013-05-09 06:46:26.086673656 +0200
196963
@@ -28,7 +28,11 @@ extern zend_module_entry zip_module_entr
196963
 #include "TSRM.h"
196963
 #endif
196963
 
196963
+#if defined(HAVE_LIBZIP)
196963
+#include <zip.h>
196963
+#else
196963
 #include "lib/zip.h"
196963
+#endif
196963
 
196963
 #define PHP_ZIP_VERSION_STRING "1.11.0"
196963
 
196963
diff -up php-5.4.15/ext/zip/tests/bug38943.phpt.systzip php-5.4.15/ext/zip/tests/bug38943.phpt
196963
--- php-5.4.15/ext/zip/tests/bug38943.phpt.systzip	2013-05-08 07:41:20.000000000 +0200
196963
+++ php-5.4.15/ext/zip/tests/bug38943.phpt	2013-05-09 06:46:26.088673667 +0200
196963
@@ -27,7 +27,7 @@ array(1) {
196963
   [0]=>
196963
   int(1)
196963
 }
196963
-object(myZip)#1 (%d) {
196963
+object(myZip)#%d (%d) {
196963
   ["test":"myZip":private]=>
196963
   int(0)
196963
   ["testp"]=>
196963
diff -up php-5.4.15/ext/zip/tests/pecl12414.phpt.systzip php-5.4.15/ext/zip/tests/pecl12414.phpt
196963
--- php-5.4.15/ext/zip/tests/pecl12414.phpt.systzip	2013-05-08 07:41:20.000000000 +0200
196963
+++ php-5.4.15/ext/zip/tests/pecl12414.phpt	2013-05-09 06:46:26.088673667 +0200
196963
@@ -5,6 +5,8 @@ Bug #12414 ( extracting files from damag
196963
 /*$ */
196963
 if(!extension_loaded('zip')) die('skip');
196963
  ?>
196963
+--XFAIL--
196963
+Doesn't work with system libzip (zip_readfile could not read from ...)
196963
 --FILE--
196963
 
196963
 $filename = 'MYLOGOV2.GFX';
196963
diff -up php-5.4.15/ext/zip/zip_stream.c.systzip php-5.4.15/ext/zip/zip_stream.c
196963
--- php-5.4.15/ext/zip/zip_stream.c.systzip	2013-05-08 07:41:20.000000000 +0200
196963
+++ php-5.4.15/ext/zip/zip_stream.c	2013-05-09 06:46:26.088673667 +0200
196963
@@ -6,7 +6,11 @@
196963
 #if HAVE_ZIP
196963
 #ifdef ZEND_ENGINE_2
196963
 
196963
+#if defined(HAVE_LIBZIP)
196963
+#include <zip.h>
196963
+#else
196963
 #include "lib/zip.h"
196963
+#endif
196963
 
196963
 #include "php_streams.h"
196963
 #include "ext/standard/file.h"