diff --git a/config.m4 b/config.m4 index 673107a..3f4ab0f 100644 --- a/config.m4 +++ b/config.m4 @@ -39,5 +39,6 @@ fi if test "$PHP_JWT" != "no"; then PHP_SUBST(JWT_SHARED_LIBADD) + PHP_ADD_EXTENSION_DEP(jwt, json) PHP_NEW_EXTENSION(jwt, jwt.c openssl.c, $ext_shared) fi diff --git a/jwt.c b/jwt.c index a682a55..4a35467 100644 --- a/jwt.c +++ b/jwt.c @@ -438,8 +438,14 @@ PHP_MINFO_FUNCTION(jwt) php_info_print_table_end(); } +static const zend_module_dep jwt_dep_deps[] = { + ZEND_MOD_REQUIRED("json") + ZEND_MOD_END +}; + zend_module_entry jwt_module_entry = { - STANDARD_MODULE_HEADER, + STANDARD_MODULE_HEADER_EX, NULL, + jwt_dep_deps, "jwt", jwt_functions, PHP_MINIT(jwt),