Skip to content

Commit

Permalink
Merge pull request #74 from remicollet/issue-phpinfo
Browse files Browse the repository at this point in the history
add MINFO method, and display both extension and library versions
  • Loading branch information
oschwald authored Nov 7, 2018
2 parents 186d2a7 + 73320ff commit 0bc057f
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 @@ -557,6 +558,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 @@ -565,7 +577,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 0bc057f

Please sign in to comment.