From c21ec44b214119479879222424a598210bb42775 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 19 Dec 2017 14:46:32 +0100 Subject: display headers (buildtime) and library (runtime) versions in phpinfo (libzip >= 1.3.1) --- ext/zip/config.m4 | 8 ++++++++ ext/zip/php_zip.c | 5 +++++ ext/zip/php_zip.h | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index 7ae43250c0..dc34cbf694 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -109,6 +109,14 @@ if test "$PHP_ZIP" != "no"; then -L$LIBZIP_LIBDIR ]) + PHP_CHECK_LIBRARY(zip, zip_libzip_version, + [ + AC_DEFINE(HAVE_LIBZIP_VERSION, 1, [Libzip >= 1.3.1 with zip_libzip_version function]) + ], [ + ], [ + -L$LIBZIP_LIBDIR + ]) + AC_DEFINE(HAVE_ZIP,1,[ ]) PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared,, $LIBZIP_CFLAGS) PHP_SUBST(ZIP_SHARED_LIBADD) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 92a5c036b4..3da018d97e 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -3304,7 +3304,12 @@ static PHP_MINFO_FUNCTION(zip) php_info_print_table_row(2, "Zip", "enabled"); php_info_print_table_row(2, "Zip version", PHP_ZIP_VERSION); +#if HAVE_LIBZIP_VERSION + php_info_print_table_row(2, "Libzip headers version", LIBZIP_VERSION); + php_info_print_table_row(2, "Libzip library version", zip_libzip_version()); +#else php_info_print_table_row(2, "Libzip version", LIBZIP_VERSION); +#endif php_info_print_table_end(); } diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 585309789e..ab412f95e1 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -37,7 +37,7 @@ extern zend_module_entry zip_module_entry; #define ZIP_OVERWRITE ZIP_TRUNCATE #endif -#define PHP_ZIP_VERSION "1.15.1" +#define PHP_ZIP_VERSION "1.15.2" #define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename) -- cgit v1.2.1 From ac4da9a0ede87a437bc75f6135e103e2d3747b09 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 19 Dec 2017 14:47:59 +0100 Subject: NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 05a584b995..bb037f1b9e 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,10 @@ PHP NEWS . Fixed bug #75671 (pg_version() crashes when called on a connection to cockroach). (magicaltux at gmail dot com) +- Zip: + . Display headers (buildtime) and library (runtime) versions in phpinfo + (with libzip >= 1.3.1). (Remi) + 14 Dec 2017, PHP 7.2.1RC1 - Core: -- cgit v1.2.1