|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-03-17 09:10 UTC] dave@php.net
Description: ------------ The current PHP extension does not seem to support the IPv6 country database (at http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz), and I had need of it, so I wrote a quick function as shown here: http://davephp.net/geoip.ipv6.patch.txt It would probably be better to incorporate this into most functions, and also add checks to only include these functions if the version of libGeoIP supported IPv6 stuff, but this is a good start! Patchesgeoip-1.1.0-ipv6-php7.patch (last revision 2015-09-23 17:31 UTC by as@php.net)geoip-1.1.0-ipv6.patch (last revision 2014-05-27 02:27 UTC by yiftachswr at gmail dot com) geoip-1.0.8-further-ipv6-fix.patch (last revision 2012-11-13 11:27 UTC by php at gnodde dot org) geoip-include-ipv6.patch (last revision 2012-06-15 11:37 UTC by dominic dot benson at thirdlight dot com) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 12:00:01 2025 UTC |
To compile it with MS VC9 the declaration of ipv4_db_available and ipv6_db_available have to be moved to the top of the block, likt this: PHP_FUNCTION(geoip_record_by_name) { GeoIP * gi; char * hostname = NULL; int arglen; int ipv4_db_available; int ipv6_db_available; GeoIPRecord * gir = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) { return; } ipv4_db_available = 1; #if LIBGEOIP_VERSION >= 1004005 ipv6_db_available = 1; #endif ....