[PHP-CVS] cvs: php-src /ext/zip config.m4 config.w32 php_zip.c php_zip.h
pajoye Fri Aug 8 18:13:55 2008 UTC Modified files: /php-src/ext/zipconfig.m4 config.w32 php_zip.c php_zip.h Log: - sync with 5.3 http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.14r2=1.15diff_format=u Index: php-src/ext/zip/config.m4 diff -u php-src/ext/zip/config.m4:1.14 php-src/ext/zip/config.m4:1.15 --- php-src/ext/zip/config.m4:1.14 Mon Jul 14 09:05:09 2008 +++ php-src/ext/zip/config.m4 Fri Aug 8 18:13:55 2008 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.14 2008/07/14 09:05:09 jani Exp $ +dnl $Id: config.m4,v 1.15 2008/08/08 18:13:55 pajoye Exp $ dnl PHP_ARG_ENABLE(zip, for zip archive read/writesupport, @@ -10,6 +10,9 @@ [ --with-zlib-dir[=DIR] ZIP: Set the path to libz install prefix], no, no) fi +PHP_ARG_WITH(pcre-dir, pcre install prefix, +[ --with-pcre-dir ZIP: pcre install prefix], no, no) + if test $PHP_ZIP != no; then if test $PHP_ZLIB_DIR != no test $PHP_ZLIB_DIR != yes; then @@ -44,6 +47,30 @@ PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) fi + dnl This is PECL build, check if bundled PCRE library is used + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS=$INCLUDES + AC_EGREP_CPP(yes,[ +#include main/php_config.h +#if defined(HAVE_BUNDLED_PCRE) !defined(COMPILE_DL_PCRE) +yes +#endif + ],[ +PHP_PCRE_REGEX=yes + ],[ +AC_EGREP_CPP(yes,[ +#include main/php_config.h +#if defined(HAVE_PCRE) !defined(COMPILE_DL_PCRE) +yes +#endif +],[ + PHP_PCRE_REGEX=pecl +],[ + PHP_PCRE_REGEX=no +]) + ]) + CPPFLAGS=$old_CPPFLAGS + PHP_ZIP_SOURCES=$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \ lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \ lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \ @@ -66,4 +93,7 @@ PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) PHP_ADD_BUILD_DIR($ext_builddir/lib, 1) PHP_SUBST(ZIP_SHARED_LIBADD) + + dnl so we always include the known-good working hack. + PHP_ADD_MAKEFILE_FRAGMENT fi http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.6r2=1.7diff_format=u Index: php-src/ext/zip/config.w32 diff -u php-src/ext/zip/config.w32:1.6 php-src/ext/zip/config.w32:1.7 --- php-src/ext/zip/config.w32:1.6 Thu Aug 7 23:23:19 2008 +++ php-src/ext/zip/config.w32 Fri Aug 8 18:13:55 2008 @@ -1,4 +1,4 @@ -// $Id: config.w32,v 1.6 2008/08/07 23:23:19 pajoye Exp $ +// $Id: config.w32,v 1.7 2008/08/08 18:13:55 pajoye Exp $ // vim:ft=javascript ARG_ENABLE(zip, ZIP support, yes); @@ -28,6 +28,7 @@ zip_set_archive_comment.c zip_set_file_comment.c \ zip_unchange_archive.c zip_memdup.c zip_stat_init.c \ zip_add_dir.c zip_file_error_clear.c zip_error_clear.c, zip); + AC_DEFINE('HAVE_ZIP', 1); } else { WARNING(zip not enabled; libraries and headers not found); http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.59r2=1.60diff_format=u Index: php-src/ext/zip/php_zip.c diff -u php-src/ext/zip/php_zip.c:1.59 php-src/ext/zip/php_zip.c:1.60 --- php-src/ext/zip/php_zip.c:1.59 Thu Jul 3 12:21:25 2008 +++ php-src/ext/zip/php_zip.c Fri Aug 8 18:13:55 2008 @@ -12,11 +12,11 @@ | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | +--+ - | Author: Piere-Alain Joye [EMAIL PROTECTED] | + | Author: Piere-Alain Joye [EMAIL PROTECTED]| +--+ */ -/* $Id: php_zip.c,v 1.59 2008/07/03 12:21:25 felipe Exp $ */ +/* $Id: php_zip.c,v 1.60 2008/08/08 18:13:55 pajoye Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -27,6 +27,7 @@ #include ext/standard/info.h #include ext/standard/file.h #include ext/standard/php_string.h +#include ext/pcre/php_pcre.h #include php_zip.h #include lib/zip.h #include lib/zipint.h @@ -43,6 +44,14 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open); static PHP_NAMED_FUNCTION(zif_zip_entry_close); +#ifdef HAVE_GLOB +#ifndef PHP_WIN32 +#include glob.h +#else +#include win32/glob.h +#endif +#endif + /* {{{ Resource le */ static int le_zip_dir; #define le_zip_dir_name Zip Directory @@ -63,7 +72,7 @@ php_error_docref(NULL TSRMLS_CC, E_NOTICE, Empty string as entry name); \ RETURN_FALSE; \ } \ - if (zip_stat(za, path, flags, sb) == -1) { \ + if (zip_stat(za, path, flags, sb) != 0) { \ RETURN_FALSE; \ } /* }}} */ @@ -107,13 +116,12 @@ if (file_len = MAXPATHLEN || zip_stat(za, file, 0, sb) != 0) { return 0; } - + /* it is a directory only, see #40228 */ if (file_len 1 file[file_len - 1] == '/') {
[PHP-CVS] cvs: php-src /ext/zip config.m4
pajoye Fri Aug 8 18:29:51 2008 UTC Modified files: /php-src/ext/zipconfig.m4 Log: - MFB: add new files http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.15r2=1.16diff_format=u Index: php-src/ext/zip/config.m4 diff -u php-src/ext/zip/config.m4:1.15 php-src/ext/zip/config.m4:1.16 --- php-src/ext/zip/config.m4:1.15 Fri Aug 8 18:13:55 2008 +++ php-src/ext/zip/config.m4 Fri Aug 8 18:29:51 2008 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.15 2008/08/08 18:13:55 pajoye Exp $ +dnl $Id: config.m4,v 1.16 2008/08/08 18:29:51 pajoye Exp $ dnl PHP_ARG_ENABLE(zip, for zip archive read/writesupport, @@ -79,7 +79,8 @@ lib/zip_error_get_sys_type.c lib/zip_file_get_offset.c \ lib/zip_get_name.c lib/zip_replace.c lib/zip_source_function.c \ lib/zip_unchange.c lib/zip_dirent.c lib/zip_error_strerror.c \ - lib/zip_file_strerror.c lib/zip_get_num_files.c \ + lib/zip_filerange_crc.c lib/zip_file_strerror.c lib/zip_get_num_files.c \ + lib/zip_get_archive_flag.c lib/zip_set_archive_flag.c \ lib/zip_set_name.c lib/zip_source_zip.c lib/zip_unchange_data.c \ lib/zip_entry_free.c lib/zip_error_to_str.c lib/zip_fopen.c \ lib/zip_name_locate.c lib/zip_source_buffer.c lib/zip_stat.c \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/zip config.m4
janiMon Jul 14 09:05:09 2008 UTC Modified files: /php-src/ext/zipconfig.m4 Log: MFB http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.13r2=1.14diff_format=u Index: php-src/ext/zip/config.m4 diff -u php-src/ext/zip/config.m4:1.13 php-src/ext/zip/config.m4:1.14 --- php-src/ext/zip/config.m4:1.13 Sun Jun 8 11:42:35 2008 +++ php-src/ext/zip/config.m4 Mon Jul 14 09:05:09 2008 @@ -1,50 +1,50 @@ dnl -dnl $Id: config.m4,v 1.13 2008/06/08 11:42:35 pajoye Exp $ +dnl $Id: config.m4,v 1.14 2008/07/14 09:05:09 jani Exp $ dnl PHP_ARG_ENABLE(zip, for zip archive read/writesupport, [ --enable-zipInclude Zip read/write support]) if test -z $PHP_ZLIB_DIR; then -PHP_ARG_WITH(zlib-dir, for the location of libz, -[ --with-zlib-dir[=DIR] ZIP: Set the path to libz install prefix], no, no) + PHP_ARG_WITH(zlib-dir, for the location of libz, + [ --with-zlib-dir[=DIR] ZIP: Set the path to libz install prefix], no, no) fi if test $PHP_ZIP != no; then - if test $PHP_ZLIB_DIR != no test $PHP_ZLIB_DIR != yes; then - if test -f $PHP_ZLIB_DIR/include/zlib/zlib.h; then - PHP_ZLIB_DIR=$PHP_ZLIB_DIR - PHP_ZLIB_INCDIR=$PHP_ZLIB_DIR/include/zlib - elif test -f $PHP_ZLIB_DIR/include/zlib.h; then - PHP_ZLIB_DIR=$PHP_ZLIB_DIR - PHP_ZLIB_INCDIR=$PHP_ZLIB_DIR/include - else - AC_MSG_ERROR([Can't find zlib headers under $PHP_ZLIB_DIR]) - fi - else - for i in /usr/local /usr; do - if test -f $i/include/zlib/zlib.h; then - PHP_ZLIB_DIR=$i - PHP_ZLIB_INCDIR=$i/include/zlib - elif test -f $i/include/zlib.h; then - PHP_ZLIB_DIR=$i - PHP_ZLIB_INCDIR=$i/include - fi - done - fi - - dnl # zlib - AC_MSG_CHECKING([for the location of zlib]) - if test $PHP_ZLIB_DIR = no; then - AC_MSG_ERROR([zip support requires ZLIB. Use --with-zlib-dir=DIR to specify prefix where ZLIB include and library are located]) - else - AC_MSG_RESULT([$PHP_ZLIB_DIR]) - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD) - PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) - fi + if test $PHP_ZLIB_DIR != no test $PHP_ZLIB_DIR != yes; then +if test -f $PHP_ZLIB_DIR/include/zlib/zlib.h; then + PHP_ZLIB_DIR=$PHP_ZLIB_DIR + PHP_ZLIB_INCDIR=$PHP_ZLIB_DIR/include/zlib +elif test -f $PHP_ZLIB_DIR/include/zlib.h; then + PHP_ZLIB_DIR=$PHP_ZLIB_DIR + PHP_ZLIB_INCDIR=$PHP_ZLIB_DIR/include +else + AC_MSG_ERROR([Can not find zlib headers under $PHP_ZLIB_DIR]) +fi + else +for i in /usr/local /usr; do + if test -f $i/include/zlib/zlib.h; then +PHP_ZLIB_DIR=$i +PHP_ZLIB_INCDIR=$i/include/zlib + elif test -f $i/include/zlib.h; then +PHP_ZLIB_DIR=$i +PHP_ZLIB_INCDIR=$i/include + fi +done + fi + + dnl # zlib + AC_MSG_CHECKING([for the location of zlib]) + if test $PHP_ZLIB_DIR = no; then +AC_MSG_ERROR([zip support requires ZLIB. Use --with-zlib-dir=DIR to specify prefix where ZLIB include and library are located]) + else +AC_MSG_RESULT([$PHP_ZLIB_DIR]) +PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD) +PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) + fi - PHP_ZIP_SOURCES=$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \ + PHP_ZIP_SOURCES=$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \ lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \ lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \ lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \ @@ -62,8 +62,8 @@ lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ lib/zip_error_clear.c lib/zip_file_error_clear.c - AC_DEFINE(HAVE_ZIP,1,[ ]) - PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) - PHP_ADD_BUILD_DIR($ext_builddir/lib, 1) - PHP_SUBST(ZIP_SHARED_LIBADD) + AC_DEFINE(HAVE_ZIP,1,[ ]) + PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) + PHP_ADD_BUILD_DIR($ext_builddir/lib, 1) + PHP_SUBST(ZIP_SHARED_LIBADD) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/zip config.m4
pajoye Tue Dec 26 09:52:32 2006 UTC Modified files: /php-src/ext/zipconfig.m4 Log: - #39952 zip ignoring --with-libdir on zlib checks (judas dot iscariote at gmail dot com) http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.9r2=1.10diff_format=u Index: php-src/ext/zip/config.m4 diff -u php-src/ext/zip/config.m4:1.9 php-src/ext/zip/config.m4:1.10 --- php-src/ext/zip/config.m4:1.9 Wed Nov 1 00:53:32 2006 +++ php-src/ext/zip/config.m4 Tue Dec 26 09:52:32 2006 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.9 2006/11/01 00:53:32 pajoye Exp $ +dnl $Id: config.m4,v 1.10 2006/12/26 09:52:32 pajoye Exp $ dnl PHP_ARG_ENABLE(zip, for zip archive read/writesupport, @@ -40,7 +40,7 @@ AC_MSG_ERROR([zip support requires ZLIB. Use --with-zlib-dir=DIR to specify prefix where ZLIB include and library are located]) else AC_MSG_RESULT([$PHP_ZLIB_DIR]) - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, ZIP_SHARED_LIBADD) + PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD) PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/zip config.m4 config.w32 php_zip.c /ext/zip/lib zip.h zip_add_dir.c zip_error.c zip_error_clear.c zip_file_error_clear.c zip_source_buffer.c zip_source_filep.c zip_stat_in
pajoye Wed Nov 1 00:53:32 2006 UTC Added files: /php-src/ext/zip/libzip_add_dir.c zip_error_clear.c zip_file_error_clear.c zip_stat_init.c Modified files: /php-src/ext/zipconfig.m4 config.w32 php_zip.c /php-src/ext/zip/libzip.h zip_error.c zip_source_buffer.c zip_source_filep.c zip_stat_index.c Log: - fix stat when used with freshly added entries - add zip_clear_error, zip_file_clear_error and zip_stat_init in libzip - add addEmptyDir(name) method, creates an empty directory http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.8r2=1.9diff_format=u Index: php-src/ext/zip/config.m4 diff -u php-src/ext/zip/config.m4:1.8 php-src/ext/zip/config.m4:1.9 --- php-src/ext/zip/config.m4:1.8 Mon Jul 24 16:58:58 2006 +++ php-src/ext/zip/config.m4 Wed Nov 1 00:53:32 2006 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.8 2006/07/24 16:58:58 pajoye Exp $ +dnl $Id: config.m4,v 1.9 2006/11/01 00:53:32 pajoye Exp $ dnl PHP_ARG_ENABLE(zip, for zip archive read/writesupport, @@ -59,7 +59,8 @@ lib/zip_entry_new.c lib/zip_err_str.c lib/zip_fopen_index.c \ lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c lib/zip_get_archive_comment.c \ lib/zip_get_file_comment.c lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \ - lib/zip_unchange_archive.c lib/zip_memdup.c + lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ + lib/zip_error_clear.c lib/zip_file_error_clear.c AC_DEFINE(HAVE_ZIP,1,[ ]) PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.1r2=1.2diff_format=u Index: php-src/ext/zip/config.w32 diff -u php-src/ext/zip/config.w32:1.1 php-src/ext/zip/config.w32:1.2 --- php-src/ext/zip/config.w32:1.1 Mon Jul 24 16:58:58 2006 +++ php-src/ext/zip/config.w32 Wed Nov 1 00:53:32 2006 @@ -1,4 +1,4 @@ -// $Id: config.w32,v 1.1 2006/07/24 16:58:58 pajoye Exp $ +// $Id: config.w32,v 1.2 2006/11/01 00:53:32 pajoye Exp $ // vim:ft=javascript ARG_ENABLE(zip, ZIP support, no); @@ -26,7 +26,8 @@ zip_new.c zip_source_file.c zip_stat_index.c \ zip_get_archive_comment.c zip_get_file_comment.c \ zip_set_archive_comment.c zip_set_file_comment.c \ - zip_unchange_archive.c zip_memdup.c, zip); + zip_unchange_archive.c zip_memdup.c zip_stat_init.c \ + zip_add_dir.c zip_file_error_clear.c zip_error_clear.c, zip); AC_DEFINE('HAVE_ZLIB', 1); AC_DEFINE('HAVE_ZIP', 1); http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.26r2=1.27diff_format=u Index: php-src/ext/zip/php_zip.c diff -u php-src/ext/zip/php_zip.c:1.26 php-src/ext/zip/php_zip.c:1.27 --- php-src/ext/zip/php_zip.c:1.26 Tue Oct 31 23:25:41 2006 +++ php-src/ext/zip/php_zip.c Wed Nov 1 00:53:32 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_zip.c,v 1.26 2006/10/31 23:25:41 pajoye Exp $ */ +/* $Id: php_zip.c,v 1.27 2006/11/01 00:53:32 pajoye Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -935,6 +935,35 @@ } /* }}} */ +/* {{{ proto bool createEmptyDir(string dirname) U +Returns the index of the entry named filename in the archive */ +ZIPARCHIVE_METHOD(addEmptyDir) +{ + struct zip *intern; + zval *this = getThis(); + char *dirname; + int dirname_len; + + if (!this) { + RETURN_FALSE; + } + + ZIP_FROM_OBJECT(intern, this); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, + dirname, dirname_len, UG(ascii_conv)) == FAILURE) { + return; + } + if (dirname_len1) { + RETURN_FALSE; + } + + if (zip_add_dir(intern, (const char *)dirname) 0) { + RETURN_FALSE; + } +} +/* }}} */ + /* {{{ proto bool addFile(string filepath[, string entryname[, int start [, int length]]]) U Add a file in a Zip archive using its path and the name to use. */ ZIPARCHIVE_METHOD(addFile) @@ -1904,6 +1933,7 @@ static zend_function_entry zip_class_functions[] = { ZIPARCHIVE_ME(open, NULL, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(close,NULL, ZEND_ACC_PUBLIC) + ZIPARCHIVE_ME(addEmptyDir, NULL, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFromString,NULL, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFile, NULL, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(renameIndex, NULL, ZEND_ACC_PUBLIC) @@ -2033,7 +2063,7 @@