From c4b82c4deea610e33d56cfe30c2fe65cb1937473 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 15 Dec 2016 18:33:57 +0000 Subject: [PATCH] Move gpgme_check_version to MINIT --- gnupg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnupg.c b/gnupg.c index cf0ad4e..a8d2809 100644 --- a/gnupg.c +++ b/gnupg.c @@ -135,7 +135,6 @@ static void gnupg_res_init(PHPC_THIS_DECLARE(gnupg) TSRMLS_DC) /* init the gpgme-lib and set the default values */ gpgme_ctx_t ctx; gpgme_error_t err; - gpgme_check_version(NULL); err = gpgme_new(&ctx); if (err == GPG_ERR_NO_ERROR) { @@ -509,6 +508,9 @@ PHP_MINIT_FUNCTION(gnupg) PHP_GNUPG_REG_CONST("GNUPG_ERROR_EXCEPTION", 2); PHP_GNUPG_REG_CONST("GNUPG_ERROR_SILENT", 3); + /* init gpgme subsystems */ + gpgme_check_version(NULL); + return SUCCESS; } /* }}} */