From: Greg Beaver Date: Sat, 24 Nov 2007 04:30:08 +0000 (+0000) Subject: preliminary work on using gnupg to verify/create signatures - no implementation,... X-Git-Tag: RELEASE_2_0_0a1~1289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e34be4f8bc6fcaa55081c15ac3d9599216f8caea;p=php preliminary work on using gnupg to verify/create signatures - no implementation, just phpinfo() output and build rules --- diff --git a/ext/phar/config.m4 b/ext/phar/config.m4 index d5a189a320..e80cf38e8d 100644 --- a/ext/phar/config.m4 +++ b/ext/phar/config.m4 @@ -9,5 +9,6 @@ if test "$PHP_PHAR" != "no"; then PHP_ADD_EXTENSION_DEP(phar, zlib, true) PHP_ADD_EXTENSION_DEP(phar, bz2, false) PHP_ADD_EXTENSION_DEP(phar, spl, false) + PHP_ADD_EXTENSION_DEP(phar, gnupg, false) PHP_ADD_MAKEFILE_FRAGMENT fi diff --git a/ext/phar/config.w32 b/ext/phar/config.w32 index 8def276a5b..035bcfefde 100644 --- a/ext/phar/config.w32 +++ b/ext/phar/config.w32 @@ -8,4 +8,5 @@ if (PHP_PHAR != "no") { ADD_EXTENSION_DEP('phar', 'zlib', true); ADD_EXTENSION_DEP('phar', 'bz2', false); ADD_EXTENSION_DEP('phar', 'spl', false); + ADD_EXTENSION_DEP('phar', 'gnupg', false); } diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 54953651cb..442c047950 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3816,6 +3816,18 @@ PHP_MINFO_FUNCTION(phar) /* {{{ */ #else php_info_print_table_row(2, "bzip2 compression", "disabled"); +#endif +#if HAVE_GNUPGLIB + if (zend_hash_exists(&module_registry, "gnupg", sizeof("gnupg"))) { + php_info_print_table_row(2, "GPG signature", + "enabled"); + } else { + php_info_print_table_row(2, "GPG signature", + "disabled (install pecl/gnupg)"); + } +#else + php_info_print_table_row(2, "GPG signature", + "disabled"); #endif php_info_print_table_end(); @@ -3838,6 +3850,9 @@ static zend_module_dep phar_deps[] = { #if HAVE_BZ2 ZEND_MOD_OPTIONAL("bz2") #endif +#if HAVE_GNUPG + ZEND_MOD_OPTIONAL("gnupg") +#endif #if HAVE_SPL ZEND_MOD_REQUIRED("spl") #endif diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index f2f2e55be8..3a482a07dc 100755 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -49,6 +49,9 @@ #include "ext/spl/spl_exceptions.h" #include "ext/spl/spl_iterators.h" #endif +#if HAVE_GNUPGLIB +#include "ext/gnupg/php_gnupg.h" +#endif #include "php_phar.h" #ifdef HAVE_STDINT_H #include