Skip to content

Commit

Permalink
display headers (buildtime) and library (runtime) versions in phpinfo…
Browse files Browse the repository at this point in the history
… (libzip >= 1.3.1)
  • Loading branch information
remicollet committed Dec 19, 2017
1 parent a1d2bf8 commit c21ec44
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ext/zip/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions ext/zip/php_zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion ext/zip/php_zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c21ec44

Please sign in to comment.