Skip to content

Commit

Permalink
add MINFO method, and display both extension and library versions
Browse files Browse the repository at this point in the history
  • Loading branch information
remicollet committed Nov 7, 2018
1 parent 7ad9bb7 commit 73320ff
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ext/maxminddb.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <php.h>
#include <zend.h>
#include "Zend/zend_exceptions.h"
#include "ext/standard/info.h"
#include <maxminddb.h>

#ifdef ZTS
Expand Down Expand Up @@ -546,6 +547,17 @@ PHP_MINIT_FUNCTION(maxminddb){
return SUCCESS;
}

static PHP_MINFO_FUNCTION(maxminddb)
{
php_info_print_table_start();

php_info_print_table_row(2, "MaxMind DB Reader", "enabled");
php_info_print_table_row(2, "maxminddb extension version", PHP_MAXMINDDB_VERSION);
php_info_print_table_row(2, "libmaxminddb library version", MMDB_lib_version());

php_info_print_table_end();
}

zend_module_entry maxminddb_module_entry = {
STANDARD_MODULE_HEADER,
PHP_MAXMINDDB_EXTNAME,
Expand All @@ -554,7 +566,7 @@ zend_module_entry maxminddb_module_entry = {
NULL,
NULL,
NULL,
NULL,
PHP_MINFO(maxminddb),
PHP_MAXMINDDB_VERSION,
STANDARD_MODULE_PROPERTIES
};
Expand Down

0 comments on commit 73320ff

Please sign in to comment.