|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch geoip_custom_directory_patch_rev2 for geoip Bug #61607Patch version 2012-04-18 01:01 UTC Return to Bug #61607 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions:Developer: tiago.peralta@sapo.pt
--- geoip.c 1970-01-01 10:13:08.000000000 +0100
+++ geoip.new2 2012-04-18 02:00:41.000000000 +0100
@@ -85,11 +85,34 @@
ZEND_GET_MODULE(geoip)
#endif
+/* {{{ PHP_INI_MH
+ */
+static PHP_INI_MH(OnUpdateDirectory)
+{
+ char* new_val = new_value;
+
+ struct stat st;
+ if( stat( new_val, &st ) == 0)
+ {
+ GEOIP_G(custom_directory) = new_value;
+ if (GeoIPDBFileName != NULL)
+ {
+ free(GeoIPDBFileName);
+ GeoIPDBFileName = NULL;
+ }
+ GeoIP_setup_custom_directory(GEOIP_G(custom_directory));
+ _GeoIP_setup_dbfilename();
+ return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ }
+
+}
+/* }}} */
+
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
#ifdef HAVE_CUSTOM_DIRECTORY
- STD_PHP_INI_ENTRY("geoip.custom_directory", NULL, PHP_INI_ALL, OnUpdateString, custom_directory, zend_geoip_globals, geoip_globals)
+ STD_PHP_INI_ENTRY("geoip.custom_directory", NULL, PHP_INI_ALL, OnUpdateDirectory, custom_directory, zend_geoip_globals, geoip_globals)
#endif
PHP_INI_END()
/* }}} */
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 09:00:01 2025 UTC |