[-]
[+]
|
Changed |
php5-geoip.spec
|
|
[-]
[+]
|
Deleted |
geoip-1.0.1-lib64.patch
^
|
@@ -1,34 +0,0 @@
-Index: config.m4
-===================================================================
---- config.m4.orig 2007-08-22 15:48:39.000000000 +0200
-+++ config.m4 2007-08-29 12:36:19.000000000 +0200
-@@ -38,12 +38,12 @@ if test "$PHP_GEOIP" != "no"; then
-
- PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- [
-- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GEOIP_DIR/lib, GEOIP_SHARED_LIBADD)
-+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GEOIP_DIR/$PHP_LIBDIR, GEOIP_SHARED_LIBADD)
- AC_DEFINE(HAVE_GEOIPLIB,1,[ ])
- ],[
- AC_MSG_ERROR([wrong geoip lib version or lib not found])
- ],[
-- -L$GEOIP_DIR/lib -lm -ldl
-+ -L$GEOIP_DIR/$PHP_LIBDIR -lm -ldl
- ])
-
- # Checking for GeoIP_setup_custom_directory in newer lib
-@@ -52,12 +52,12 @@ if test "$PHP_GEOIP" != "no"; then
- AC_DEFINE(HAVE_CUSTOM_DIRECTORY,1,[ ])
- ],[
- ],[
-- -L$GEOIP_DIR/lib -lm -ldl
-+ -L$GEOIP_DIR/$PHP_LIBDIR -lm -ldl
- ])
-
- # Check to see if we are using the LGPL library (version 1.4.0 and newer)
- AC_MSG_CHECKING([for LGPL compatible GeoIP libs])
-- libgeoip_full_version=`find $GEOIP_DIR/lib/ -name libGeoIP.\*.\*.\*.\* | cut -d . -f 2-5`
-+ libgeoip_full_version=`find $GEOIP_DIR/$PHP_LIBDIR/ -name libGeoIP.\*.\*.\*.\* | cut -d . -f 2-5`
- ac_IFS=$IFS
- IFS="."
- set $libgeoip_full_version
|
[-]
[+]
|
Deleted |
geoip-1.0.6-lib64.patch
^
|
@@ -1,41 +0,0 @@
---- config.m4.orig 2009-01-20 20:52:37.000000000 +0100
-+++ config.m4 2009-01-20 20:54:17.000000000 +0100
-@@ -38,12 +38,12 @@
-
- PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- [
-- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GEOIP_DIR/lib, GEOIP_SHARED_LIBADD)
-+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GEOIP_DIR/$PHP_LIBDIR, GEOIP_SHARED_LIBADD)
- AC_DEFINE(HAVE_GEOIPLIB,1,[ ])
- ],[
- AC_MSG_ERROR([wrong geoip lib version or lib not found])
- ],[
-- -L$GEOIP_DIR/lib -lm -ldl
-+ -L$GEOIP_DIR/$PHP_LIBDIR -lm -ldl
- ])
-
- # Checking for GeoIP_setup_custom_directory in newer lib
-@@ -52,7 +52,7 @@
- AC_DEFINE(HAVE_CUSTOM_DIRECTORY,1,[ ])
- ],[
- ],[
-- -L$GEOIP_DIR/lib -lm -ldl
-+ -L$GEOIP_DIR/$PHP_LIBDIR -lm -ldl
- ])
-
- # Checking for GeoIP_continent_by_id in newer lib
-@@ -61,12 +61,12 @@
- AC_DEFINE(HAVE_CONTINENT_BY_ID,1,[ ])
- ],[
- ],[
-- -L$GEOIP_DIR/lib -lm -ldl
-+ -L$GEOIP_DIR/$PHP_LIBDIR -lm -ldl
- ])
-
- # Check to see if we are using the LGPL library (version 1.4.0 and newer)
- AC_MSG_CHECKING([for LGPL compatible GeoIP libs])
-- libgeoip_full_version=`find $GEOIP_DIR/lib/ -name libGeoIP.\*.\*.\*.\* | cut -d . -f 2-5 | sort`
-+ libgeoip_full_version=`find $GEOIP_DIR/$PHP_LIBDIR/ -name libGeoIP.\*.\*.\*.\* | cut -d . -f 2-5 | sort`
- for lines in $libgeoip_full_version; do
- ac_IFS=$IFS
- IFS="."
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/ChangeLog
^
|
@@ -1,66 +0,0 @@
-1.0.5 2008-12-19
-
- * Small bug in phpinfo() when printing version number could crash PHP.
-
-1.0.4 2008-12-19
-
- * Fix memleaks, bug #14851
- * Small patch for MacPorts by jhohle
- * Add geoip_time_zone_by_country_and_region() and geoip_region_name_by_code() (thanks to Sid Dunayer)
- * Add continent_code field for City Database, only if using GeoIP lib 1.4.3 or newer
-
-1.0.3 2008-06-12
-
- * Change license from PHP 3.0 to PHP 3.01 for Debian?
- * Added geoip_continent_code_by_name() to get continent instead of country
- * Fixing a small casting issue (compiler warning)
- * Fixing missing entries in geoip_record_by_name, bug #14131
-
-1.0.2 2007-11-20
-
- * Added geoip_isp_by_name (patch by Yannick Gard)
-
-1.0.1 2007-08-22
-
- * Added geoip_db_avail() to check for DB availability (file found)
- * Added geoip_db_filename() to get the internal file name of the library
- * Added geoip_db_get_all_info() to fetch all info about all database types
- * Added some tests so that make test can crunch something.
- * Added database file path and name in warning when DB is not found.
- * Added geoip.custom_directory php.ini option to change default path for DBs
-
-1.0.0 2007-08-14
-
- * Marked as stable
- * Fixing wrong version number inside extension
-
-0.2.0 2006-08-22
-
- * Initial PECL Release
- * Fixing various memory leaks
- * Registering the C API constants in PHP
-
-0.1.3 2006-7-10
-
-Following changes made by Olivier Hill
- * Missing PHP function prototypes
- * Fixing code foldings in Emacs
- * Outputting E_NOTICES instead of E_WARNING when non fatal errors
- * Return type of longitude/latitude should be DOUBLE and not LONG
-
-0.1.2 2006-5-19
- * Following changes all contributed by Guenter Knauf
-- moved argument parsing up at various places before we create a GeoIP.
-- moved GeoIP_delete() call at various places up to get it called before we error out.
-- fixed one place where a missing return caused a segfault on all platforms because
- RETURN_STRING() was called with NULL when GeoIP lookup failed.
-- added php.ini entry parsing; prepared for usage of geoip.database_standard var.
- This works fine so far as you can test with the geoip_database_info() call which uses
- the database configured with the geoip.database_standard var; if not set it defaults
- to the usual place specified during compile time with GEOIPDATADIR. All other functions
- currently still ignore the geoip.database_standard setting, but default usually also
- to GEOIPDATADIR from what I see. Search for the dirty '//' comments ....
- * Added config.m4, contributed by Jonathan Whiteman of cyberflowsolutions.com
-
-0.1.1 2005-9-21
- * Initial release, contributed by Matthew Fonda
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/config.m4
^
|
@@ -1,95 +0,0 @@
-dnl $Id: config.m4,v 1.5 2008/10/19 21:27:53 ohill Exp $
-dnl config.m4 for extension geoip
-
-dnl Base file contributed by Jonathan Whiteman of cyberflowsolutions.com
-
-PHP_ARG_WITH(geoip, for geoip support,
-dnl Make sure that the comment is aligned:
-[ --with-geoip Include GeoIP support])
-
-if test "$PHP_GEOIP" != "no"; then
-
- # --with-geoip -> check with-path
- SEARCH_PATH="/usr/local /usr /sw /opt/local"
- SEARCH_FOR="/include/GeoIP.h"
- if test -r $PHP_GEOIP/$SEARCH_FOR; then
- GEOIP_DIR=$PHP_GEOIP
- else # search default path list
- AC_MSG_CHECKING([for geoip files in default path])
- for i in $SEARCH_PATH ; do
- if test -r $i/$SEARCH_FOR; then
- GEOIP_DIR=$i
- AC_MSG_RESULT([found in $i])
- fi
- done
- fi
-
- if test -z "$GEOIP_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Please reinstall the geoip distribution])
- fi
-
- # --with-geoip -> add include path
- PHP_ADD_INCLUDE($GEOIP_DIR/include)
-
- # --with-geoip -> check for lib and symbol presence
- LIBNAME=GeoIP # you may want to change this
- LIBSYMBOL=GeoIP_open # you most likely want to change this
-
- PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- [
- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GEOIP_DIR/lib, GEOIP_SHARED_LIBADD)
- AC_DEFINE(HAVE_GEOIPLIB,1,[ ])
- ],[
- AC_MSG_ERROR([wrong geoip lib version or lib not found])
- ],[
- -L$GEOIP_DIR/lib -lm -ldl
- ])
-
- # Checking for GeoIP_setup_custom_directory in newer lib
- PHP_CHECK_LIBRARY($LIBNAME,GeoIP_setup_custom_directory,
- [
- AC_DEFINE(HAVE_CUSTOM_DIRECTORY,1,[ ])
- ],[
- ],[
- -L$GEOIP_DIR/lib -lm -ldl
- ])
-
- # Checking for GeoIP_continent_by_id in newer lib
- PHP_CHECK_LIBRARY($LIBNAME,GeoIP_continent_by_id,
- [
- AC_DEFINE(HAVE_CONTINENT_BY_ID,1,[ ])
- ],[
- ],[
- -L$GEOIP_DIR/lib -lm -ldl
- ])
-
- # Check to see if we are using the LGPL library (version 1.4.0 and newer)
- AC_MSG_CHECKING([for LGPL compatible GeoIP libs])
- libgeoip_full_version=`find $GEOIP_DIR/lib/ -name libGeoIP.\*.\*.\*.\* | cut -d . -f 2-5`
- ac_IFS=$IFS
- IFS="."
- set $libgeoip_full_version
- IFS=$ac_IFS
-
- # Version after the suffix (eg: .so.1.4.0)
- if test "[$]1" = "$SHLIB_SUFFIX_NAME"; then
- LIBGEOIP_VERSION=`expr [$]2 \* 1000000 + [$]3 \* 1000 + [$]4`
- # Version before the suffix (eg: 1.4.0.dylib on OS X)
- else
- LIBGEOIP_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
- fi
-
- if test "$LIBGEOIP_VERSION" -lt "1004000"; then
- AC_MSG_RESULT([wrong version])
- AC_MSG_ERROR([You need version 1.4.0 or higher of the C API])
- else
- AC_MSG_RESULT([found $LIBGEOIP_VERSION])
- AC_DEFINE_UNQUOTED(LIBGEOIP_VERSION, $LIBGEOIP_VERSION, [ ])
- fi
-
- PHP_SUBST(GEOIP_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION(geoip, geoip.c, $ext_shared)
-fi
-
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/geoip.c
^
|
@@ -1,653 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Olivier Hill <ohill@php.net> |
- | Matthew Fonda |
- +----------------------------------------------------------------------+
- Please contact support@maxmind.com with any comments
-*/
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <GeoIP.h>
-#include <GeoIPCity.h>
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_geoip.h"
-
-
-
-ZEND_DECLARE_MODULE_GLOBALS(geoip)
-
-static int le_geoip;
-
-/* {{{ */
-function_entry geoip_functions[] = {
- PHP_FE(geoip_database_info, NULL)
- PHP_FE(geoip_country_code_by_name, NULL)
- PHP_FE(geoip_country_code3_by_name, NULL)
- PHP_FE(geoip_country_name_by_name, NULL)
- PHP_FE(geoip_continent_code_by_name, NULL)
- PHP_FE(geoip_org_by_name, NULL)
- PHP_FE(geoip_record_by_name, NULL)
- PHP_FE(geoip_id_by_name, NULL)
- PHP_FE(geoip_region_by_name, NULL)
- PHP_FE(geoip_isp_by_name, NULL)
- PHP_FE(geoip_db_avail, NULL)
- PHP_FE(geoip_db_get_all_info, NULL)
- PHP_FE(geoip_db_filename, NULL)
-#if LIBGEOIP_VERSION >= 1004001
- PHP_FE(geoip_region_name_by_code, NULL)
- PHP_FE(geoip_time_zone_by_country_and_region, NULL)
-#endif
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ geoip_module_entry
- */
-zend_module_entry geoip_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
- STANDARD_MODULE_HEADER,
-#endif
- "geoip",
- geoip_functions,
- PHP_MINIT(geoip),
- PHP_MSHUTDOWN(geoip),
- PHP_RINIT(geoip),
- PHP_RSHUTDOWN(geoip),
- PHP_MINFO(geoip),
-#if ZEND_MODULE_API_NO >= 20010901
- PHP_GEOIP_VERSION, /* version number of the extension */
-#endif
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-#ifdef COMPILE_DL_GEOIP
-ZEND_GET_MODULE(geoip)
-#endif
-
-/* {{{ 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)
-#endif
-PHP_INI_END()
-/* }}} */
-
-/* {{{ php_geoip_init_globals
- */
-static void php_geoip_init_globals(zend_geoip_globals *geoip_globals)
-{
- geoip_globals->custom_directory = NULL;
-}
-/* }}} */
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(geoip)
-{
- ZEND_INIT_MODULE_GLOBALS(geoip, php_geoip_init_globals, NULL);
- REGISTER_INI_ENTRIES();
-
- /* @TODO: Do something for custom_directory before initialization here */
-
-#ifdef HAVE_CUSTOM_DIRECTORY
- GeoIP_setup_custom_directory(GEOIP_G(custom_directory));
-#endif
-
- _GeoIP_setup_dbfilename();
-
- /* For database type constants */
- REGISTER_LONG_CONSTANT("GEOIP_COUNTRY_EDITION", GEOIP_COUNTRY_EDITION, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_REGION_EDITION_REV0", GEOIP_REGION_EDITION_REV0, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_CITY_EDITION_REV0", GEOIP_CITY_EDITION_REV0, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_ORG_EDITION", GEOIP_ORG_EDITION, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_ISP_EDITION", GEOIP_ISP_EDITION, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_CITY_EDITION_REV1", GEOIP_CITY_EDITION_REV1, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_REGION_EDITION_REV1", GEOIP_REGION_EDITION_REV1, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_PROXY_EDITION", GEOIP_PROXY_EDITION, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_ASNUM_EDITION", GEOIP_ASNUM_EDITION, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_NETSPEED_EDITION", GEOIP_NETSPEED_EDITION, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_DOMAIN_EDITION", GEOIP_DOMAIN_EDITION, CONST_CS | CONST_PERSISTENT);
-
- /* For netspeed constants */
- REGISTER_LONG_CONSTANT("GEOIP_UNKNOWN_SPEED", GEOIP_UNKNOWN_SPEED, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_DIALUP_SPEED", GEOIP_DIALUP_SPEED, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_CABLEDSL_SPEED", GEOIP_CABLEDSL_SPEED, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("GEOIP_CORPORATE_SPEED", GEOIP_CORPORATE_SPEED, CONST_CS | CONST_PERSISTENT);
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(geoip)
-{
- return SUCCESS;
-}
-/* }}} */
-
-
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(geoip)
-{
- return SUCCESS;
-}
-/* }}} */
-
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(geoip)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(geoip)
-{
- char buf[32];
-
- php_info_print_table_start();
- php_info_print_table_header(2, "geoip support", "enabled");
- php_info_print_table_row(2, "geoip extension version", PHP_GEOIP_VERSION);
- snprintf(buf, sizeof(buf), "%d", LIBGEOIP_VERSION);
- php_info_print_table_row(2, "geoip library version", buf);
- php_info_print_table_end();
- DISPLAY_INI_ENTRIES();
-}
-/* }}} */
-
-/* {{{ proto boolean geoip_db_avail( [ int database ] ) */
-PHP_FUNCTION(geoip_db_avail)
-{
- long edition;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &edition) == FAILURE) {
- return;
- }
-
- if (edition < 0 || edition >= NUM_DB_TYPES)
- {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database type given is out of bound.");
- return;
- }
-
- RETURN_BOOL(GeoIP_db_avail(edition));
-}
-/* }}} */
-
-/* {{{ proto string geoip_db_filename( [ int database ] ) */
-PHP_FUNCTION(geoip_db_filename)
-{
- long edition;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &edition) == FAILURE) {
- return;
- }
-
- if (edition < 0 || edition >= NUM_DB_TYPES)
- {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database type given is out of bound.");
- return;
- }
-
- if (NULL != GeoIPDBFileName[edition])
- RETURN_STRING(GeoIPDBFileName[edition], 1);
-}
-/* }}} */
-
-/* {{{ proto array geoip_db_get_all_info( ) */
-PHP_FUNCTION(geoip_db_get_all_info)
-{
- int i;
-
- array_init(return_value);
-
- for (i=0; i < NUM_DB_TYPES; i++)
- {
- if (NULL != GeoIPDBDescription[i])
- {
- zval *row;
- ALLOC_INIT_ZVAL(row);
- array_init(row);
-
- add_assoc_bool(row, "available", GeoIP_db_avail(i));
- add_assoc_string(row, "description", (char *)GeoIPDBDescription[i], 1);
- add_assoc_string(row, "filename", GeoIPDBFileName[i], 1);
-
- add_index_zval(return_value, i, row);
- }
- }
-}
-/* }}} */
-
-/* {{{ proto string geoip_database_info( [ int database ] )
- Returns GeoIP Database information */
-PHP_FUNCTION(geoip_database_info)
-{
- GeoIP * gi;
- char * db_info;
- long edition = GEOIP_COUNTRY_EDITION;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &edition) == FAILURE) {
- return;
- }
-
- if (edition < 0 || edition >= NUM_DB_TYPES)
- {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database type given is out of bound.");
- return;
- }
-
- if (GeoIP_db_avail(edition)) {
- gi = GeoIP_open_type(edition, GEOIP_STANDARD);
- } else {
- if (NULL != GeoIPDBFileName[edition])
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
- else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available.");
- return;
- }
-
- db_info = GeoIP_database_info(gi);
- GeoIP_delete(gi);
-
- RETVAL_STRING(db_info, 1);
- free(db_info);
-}
-/* }}} */
-
-/* {{{ proto string geoip_country_code_by_name( string hostname )
- Return the Country Code found in the GeoIP Database */
-PHP_FUNCTION(geoip_country_code_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- const char * country_code;
- int arglen;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION)) {
- gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
- return;
- }
-
- country_code = GeoIP_country_code_by_name(gi, hostname);
- GeoIP_delete(gi);
- if (country_code == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
- RETURN_STRING((char*)country_code, 1);
-}
-/* }}} */
-
-/* {{{ proto string geoip_country_code_by_name( string hostname )
- Return the Country Code found in the GeoIP Database */
-PHP_FUNCTION(geoip_country_code3_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- const char * country_code;
- int arglen;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION)) {
- gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
- return;
- }
-
- country_code = GeoIP_country_code3_by_name(gi, hostname);
- GeoIP_delete(gi);
- if (country_code == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
- RETURN_STRING((char*)country_code, 1);
-}
-/* }}} */
-
-/* {{{ proto string geoip_country_name_by_name( string hostname )
- Returns the Country name found in the GeoIP Database */
-PHP_FUNCTION(geoip_country_name_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- const char * country_name;
- int arglen;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION)) {
- gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
- return;
- }
-
- country_name = GeoIP_country_name_by_name(gi, hostname);
- GeoIP_delete(gi);
- if (country_name == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
- RETURN_STRING((char*)country_name, 1);
-}
-/* }}} */
-
-/* {{{ proto string geoip_continent_code_by_name( string hostname )
- Returns the Continent name found in the GeoIP Database */
-PHP_FUNCTION(geoip_continent_code_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- int id;
- int arglen;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION)) {
- gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
- return;
- }
-
- id = GeoIP_id_by_name(gi, hostname);
- GeoIP_delete(gi);
- if (id == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
- RETURN_STRING((char *)GeoIP_country_continent[id], 1);
-}
-/* }}} */
-
-/* {{{ proto string geoip_org_by_name( string hostname )
- Returns the Organization Name found in the GeoIP Database */
-PHP_FUNCTION(geoip_org_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- char * org;
- int arglen;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_ORG_EDITION)) {
- gi = GeoIP_open_type(GEOIP_ORG_EDITION, GEOIP_STANDARD);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_ORG_EDITION]);
- return;
- }
-
- org = GeoIP_org_by_name(gi, hostname);
- GeoIP_delete(gi);
- if (org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
- RETVAL_STRING(org, 1);
- free(org);
-}
-/* }}} */
-
-/* {{{ proto array geoip_record_by_name( string hostname )
- Returns the detailed City information found in the GeoIP Database */
-PHP_FUNCTION(geoip_record_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- int arglen;
- GeoIPRecord * gir;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1) || GeoIP_db_avail(GEOIP_CITY_EDITION_REV0)) {
- if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1)) {
- gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV1, GEOIP_STANDARD);
- } else {
- gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV0, GEOIP_STANDARD);
- }
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_CITY_EDITION_REV0]);
- return;
- }
- gir = GeoIP_record_by_name(gi, hostname);
-
- GeoIP_delete(gi);
-
- if (NULL == gir) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
-
- array_init(return_value);
-#if LIBGEOIP_VERSION >= 1004003
- add_assoc_string(return_value, "continent_code", (gir->continent_code == NULL) ? "" : gir->continent_code, 1);
-#endif
- add_assoc_string(return_value, "country_code", (gir->country_code == NULL) ? "" : gir->country_code, 1);
- add_assoc_string(return_value, "country_code3", (gir->country_code3 == NULL) ? "" : gir->country_code3, 1);
- add_assoc_string(return_value, "country_name", (gir->country_name == NULL) ? "" : gir->country_name, 1);
- add_assoc_string(return_value, "region", (gir->region == NULL) ? "" : gir->region, 1);
- add_assoc_string(return_value, "city", (gir->city == NULL) ? "" : gir->city, 1);
- add_assoc_string(return_value, "postal_code", (gir->postal_code == NULL) ? "" : gir->postal_code, 1);
- add_assoc_double(return_value, "latitude", gir->latitude);
- add_assoc_double(return_value, "longitude", gir->longitude);
-#if LIBGEOIP_VERSION >= 1004005
- add_assoc_long(return_value, "dma_code", gir->metro_code);
-#else
- add_assoc_long(return_value, "dma_code", gir->dma_code);
-#endif
- add_assoc_long(return_value, "area_code", gir->area_code);
-
- GeoIPRecord_delete(gir);
-}
-/* }}} */
-
-/* {{{ proto integer geoip_id_by_name( string hostname )
- Returns the Net Speed found in the GeoIP Database */
-PHP_FUNCTION(geoip_id_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- int arglen;
- int netspeed;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_NETSPEED_EDITION)) {
- gi = GeoIP_open_type(GEOIP_NETSPEED_EDITION, GEOIP_STANDARD);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_NETSPEED_EDITION]);
- return;
- }
-
- netspeed = GeoIP_id_by_name(gi, hostname);
- GeoIP_delete(gi);
- RETURN_LONG(netspeed);
-}
-/* }}} */
-
-/* {{{ proto array geoip_region_by_name( string hostname )
- Returns the Country Code and region found in the GeoIP Database */
-PHP_FUNCTION(geoip_region_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- int arglen;
- GeoIPRegion * region;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV0) || GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) {
- if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) {
- gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV1, GEOIP_STANDARD);
- } else {
- gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV0, GEOIP_STANDARD);
- }
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_REGION_EDITION_REV0]);
- return;
- }
-
- region = GeoIP_region_by_name(gi, hostname);
- GeoIP_delete(gi);
-
- if (NULL == region) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
-
- array_init(return_value);
- add_assoc_string(return_value, "country_code", region->country_code, 1);
- add_assoc_string(return_value, "region", region->region, 1);
-
- GeoIPRegion_delete(region);
-}
-/* }}} */
-
-/* {{{ proto string geoip_isp_by_name( string hostname )
- Returns the ISP Name found in the GeoIP Database */
-PHP_FUNCTION(geoip_isp_by_name)
-{
- GeoIP * gi;
- char * hostname = NULL;
- char * isp;
- int arglen;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
- return;
- }
-
- if (GeoIP_db_avail(GEOIP_ISP_EDITION)) {
- gi = GeoIP_open_type(GEOIP_ISP_EDITION, GEOIP_STANDARD);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_ISP_EDITION]);
- return;
- }
-
- isp = GeoIP_name_by_name(gi, hostname);
- GeoIP_delete(gi);
- if (isp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
- RETURN_FALSE;
- }
- RETVAL_STRING(isp, 1);
- free(isp);
-}
-
-#if LIBGEOIP_VERSION >= 1004001
-/* {{{ proto string geoip_region_name_by_code( string country_code, string region_code )
- Returns the region name for some country code and region code combo */
-PHP_FUNCTION(geoip_region_name_by_code)
-{
- GeoIP * gi;
- char * country_code = NULL;
- char * region_code = NULL;
- const char * region_name;
- int countrylen, regionlen;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &country_code, &countrylen, ®ion_code, ®ionlen) == FAILURE) {
- return;
- }
-
- if (!countrylen || !regionlen) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You need to specify the country and region codes.");
- RETURN_FALSE;
- }
-
- region_name = GeoIP_region_name_by_code(country_code, region_code);
- if (region_name == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Region name not found for %s/%s", country_code, region_code);
- RETURN_FALSE;
- }
- RETURN_STRING((char*)region_name, 1);
-}
-/* }}} */
-#endif
-
-#if LIBGEOIP_VERSION >= 1004001
-/* {{{ proto string geoip_time_zone_by_country_and_region( string country, string region )
- Returns the time zone for some country code and region code combo */
-PHP_FUNCTION(geoip_time_zone_by_country_and_region)
-{
- GeoIP * gi;
- char * country = NULL;
- char * region = NULL;
- const char * timezone;
- int countrylen, arg2len;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &country, &countrylen, ®ion, &arg2len) == FAILURE) {
- return;
- }
-
- if (!countrylen) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You need to specify at least the country code.");
- RETURN_FALSE;
- }
-
- timezone = GeoIP_time_zone_by_country_and_region(country, region);
- if (timezone == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone not found for %s/%s", country, region);
- RETURN_FALSE;
- }
- RETURN_STRING((char*)timezone, 1);
-}
-/* }}} */
-#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/php_geoip.h
^
|
@@ -1,87 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Olivier Hill <ohill@php.net> |
- | Matthew Fonda |
- +----------------------------------------------------------------------+
- Please contact support@maxmind.com with any comments
-*/
-
-#ifndef PHP_GEOIP_H
-#define PHP_GEOIP_H
-
-extern zend_module_entry geoip_module_entry;
-#define phpext_geoip_ptr &geoip_module_entry
-
-#define PHP_GEOIP_VERSION "1.0.5"
-
-#ifdef PHP_WIN32
-#define PHP_GEOIP_API __declspec(dllexport)
-#else
-#define PHP_GEOIP_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-#include <GeoIP.h>
-#include <GeoIPCity.h>
-
-PHP_MINIT_FUNCTION(geoip);
-PHP_MSHUTDOWN_FUNCTION(geoip);
-PHP_RINIT_FUNCTION(geoip);
-PHP_RSHUTDOWN_FUNCTION(geoip);
-PHP_MINFO_FUNCTION(geoip);
-
-
-PHP_FUNCTION(geoip_database_info);
-PHP_FUNCTION(geoip_country_code_by_name);
-PHP_FUNCTION(geoip_country_code3_by_name);
-PHP_FUNCTION(geoip_country_name_by_name);
-PHP_FUNCTION(geoip_continent_code_by_name);
-PHP_FUNCTION(geoip_org_by_name);
-PHP_FUNCTION(geoip_record_by_name);
-PHP_FUNCTION(geoip_id_by_name);
-PHP_FUNCTION(geoip_region_by_name);
-PHP_FUNCTION(geoip_isp_by_name);
-PHP_FUNCTION(geoip_db_avail);
-PHP_FUNCTION(geoip_db_get_all_info);
-PHP_FUNCTION(geoip_db_filename);
-#if LIBGEOIP_VERSION >= 1004001
-PHP_FUNCTION(geoip_region_name_by_code);
-PHP_FUNCTION(geoip_time_zone_by_country_and_region);
-#endif
-
-ZEND_BEGIN_MODULE_GLOBALS(geoip)
- char* custom_directory;
-ZEND_END_MODULE_GLOBALS(geoip)
-
-#ifdef ZTS
-#define GEOIP_G(v) TSRMG(geoip_globals_id, zend_geoip_globals *, v)
-#else
-#define GEOIP_G(v) (geoip_globals.v)
-#endif
-
-#endif /* PHP_GEOIP_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/tests/008.phpt
^
|
@@ -1,12 +0,0 @@
---TEST--
-Calling geoip_db_filename() with a non-existant database type within bound.
---SKIPIF--
-<?php if (!extension_loaded("geoip")) print "skip"; ?>
---FILE--
-<?php
-
-var_dump( geoip_db_filename(14) );
-
-?>
---EXPECT--
-NULL
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/tests/009.phpt
^
|
@@ -1,12 +0,0 @@
---TEST--
-Calling geoip_db_avail() with a non-existant database type within bound.
---SKIPIF--
-<?php if (!extension_loaded("geoip")) print "skip"; ?>
---FILE--
-<?php
-
-var_dump( geoip_db_avail(14) );
-
-?>
---EXPECT--
-bool(false)
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/tests/011.phpt
^
|
@@ -1,12 +0,0 @@
---TEST--
-Calling geoip_database_info() with a non-existant database type within bound.
---SKIPIF--
-<?php if (!extension_loaded("geoip")) print "skip"; ?>
---FILE--
-<?php
-
-geoip_database_info(14);
-
-?>
---EXPECTF--
-Warning: geoip_database_info(): Required database not available. in %s on line %d
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/tests/013.phpt
^
|
@@ -1,14 +0,0 @@
---TEST--
-Checking timezone info
---SKIPIF--
-<?php if (!extension_loaded("geoip")) print "skip"; ?>
---POST--
---GET--
---FILE--
-<?php
-
-var_dump(geoip_time_zone_by_country_and_region('CA','QC'));
-
-?>
---EXPECT--
-string(16) "America/Montreal"
|
[-]
[+]
|
Deleted |
geoip-1.0.5.tgz/geoip-1.0.5/tests/016.phpt
^
|
@@ -1,36 +0,0 @@
---TEST--
-Checking geoip_region_name_by_code with (some) empty fields
---SKIPIF--
-<?php if (!extension_loaded("geoip")) print "skip"; ?>
---POST--
---GET--
---FILE--
-<?php
-
-var_dump(geoip_region_name_by_code('CA',''));
-var_dump(geoip_region_name_by_code('CA',NULL));
-var_dump(geoip_region_name_by_code('CA',1));
-var_dump(geoip_region_name_by_code('','QC'));
-var_dump(geoip_region_name_by_code(NULL,'QC'));
-var_dump(geoip_region_name_by_code(1,'QC'));
-
-?>
---EXPECTF--
-
-Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
-bool(false)
-
-Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
-bool(false)
-
-Notice: geoip_region_name_by_code(): Region name not found for %s in %s on line %d
-bool(false)
-
-Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
-bool(false)
-
-Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
-bool(false)
-
-Notice: geoip_region_name_by_code(): Region name not found for %s in %s on line %d
-bool(false)
|
|
Deleted |
geoip-1.0.6.tgz
^
|
|
Deleted |
geoip-1.0.7.tgz
^
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/ChangeLog
^
|
@@ -0,0 +1,76 @@
+1.0.7 2009-03-11
+
+ * Do not issue a NOTICE when values don't exist for timezone and region name (as added in 1.0.4)
+ * Fix a compile issue on FreeBSD
+ * Try to be bulletproof on library features detection.
+
+1.0.6 2009-01-20
+
+ * Fixing compile bug when multiple GeoIP libs are installed, bug #15372
+
+1.0.5 2008-12-19
+
+ * Small bug in phpinfo() when printing version number could crash PHP.
+
+1.0.4 2008-12-19
+
+ * Fix memleaks, bug #14851
+ * Small patch for MacPorts by jhohle
+ * Add geoip_time_zone_by_country_and_region() and geoip_region_name_by_code() (thanks to Sid Dunayer)
+ * Add continent_code field for City Database, only if using GeoIP lib 1.4.3 or newer
+
+1.0.3 2008-06-12
+
+ * Change license from PHP 3.0 to PHP 3.01 for Debian?
+ * Added geoip_continent_code_by_name() to get continent instead of country
+ * Fixing a small casting issue (compiler warning)
+ * Fixing missing entries in geoip_record_by_name, bug #14131
+
+1.0.2 2007-11-20
+
+ * Added geoip_isp_by_name (patch by Yannick Gard)
+
+1.0.1 2007-08-22
+
+ * Added geoip_db_avail() to check for DB availability (file found)
+ * Added geoip_db_filename() to get the internal file name of the library
+ * Added geoip_db_get_all_info() to fetch all info about all database types
+ * Added some tests so that make test can crunch something.
+ * Added database file path and name in warning when DB is not found.
+ * Added geoip.custom_directory php.ini option to change default path for DBs
+
+1.0.0 2007-08-14
+
+ * Marked as stable
+ * Fixing wrong version number inside extension
+
+0.2.0 2006-08-22
+
+ * Initial PECL Release
+ * Fixing various memory leaks
+ * Registering the C API constants in PHP
+
+0.1.3 2006-7-10
+
+Following changes made by Olivier Hill
+ * Missing PHP function prototypes
+ * Fixing code foldings in Emacs
+ * Outputting E_NOTICES instead of E_WARNING when non fatal errors
+ * Return type of longitude/latitude should be DOUBLE and not LONG
+
+0.1.2 2006-5-19
+ * Following changes all contributed by Guenter Knauf
+- moved argument parsing up at various places before we create a GeoIP.
+- moved GeoIP_delete() call at various places up to get it called before we error out.
+- fixed one place where a missing return caused a segfault on all platforms because
+ RETURN_STRING() was called with NULL when GeoIP lookup failed.
+- added php.ini entry parsing; prepared for usage of geoip.database_standard var.
+ This works fine so far as you can test with the geoip_database_info() call which uses
+ the database configured with the geoip.database_standard var; if not set it defaults
+ to the usual place specified during compile time with GEOIPDATADIR. All other functions
+ currently still ignore the geoip.database_standard setting, but default usually also
+ to GEOIPDATADIR from what I see. Search for the dirty '//' comments ....
+ * Added config.m4, contributed by Jonathan Whiteman of cyberflowsolutions.com
+
+0.1.1 2005-9-21
+ * Initial release, contributed by Matthew Fonda
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/README
^
|
(renamed from geoip-1.0.5/README)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/README
^
|
(renamed from geoip-1.0.5/README)
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/config.m4
^
|
@@ -0,0 +1,127 @@
+dnl $Id: config.m4 276796 2009-03-05 12:52:25Z ohill $
+dnl config.m4 for extension geoip
+
+dnl Base file contributed by Jonathan Whiteman of cyberflowsolutions.com
+
+PHP_ARG_WITH(geoip, for geoip support,
+dnl Make sure that the comment is aligned:
+[ --with-geoip Include GeoIP support])
+
+if test "$PHP_GEOIP" != "no"; then
+
+ # --with-geoip -> check with-path
+ SEARCH_PATH="/usr/local /usr /sw /opt/local"
+ SEARCH_FOR="/include/GeoIP.h"
+ if test -r $PHP_GEOIP/$SEARCH_FOR; then
+ GEOIP_DIR=$PHP_GEOIP
+ else # search default path list
+ AC_MSG_CHECKING([for geoip files in default path])
+ for i in $SEARCH_PATH ; do
+ if test -r $i/$SEARCH_FOR; then
+ GEOIP_DIR=$i
+ AC_MSG_RESULT([found in $i])
+ fi
+ done
+ fi
+
+ if test -z "$GEOIP_DIR"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Please reinstall the geoip distribution])
+ fi
+
+ # --with-geoip -> add include path
+ PHP_ADD_INCLUDE($GEOIP_DIR/include)
+
+ # odd PHP4 fix
+ if test "x$PHP_LIBDIR" = "x"; then
+ PHP_LIBDIR=lib
+ fi
+
+ # --with-geoip -> check for lib and symbol presence
+ LIBNAME=GeoIP # you may want to change this
+ LIBSYMBOL=GeoIP_open # you most likely want to change this
+
+ PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
+ [
+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GEOIP_DIR/lib, GEOIP_SHARED_LIBADD)
+ AC_DEFINE(HAVE_GEOIPLIB,1,[ ])
+ ],[
+ AC_MSG_ERROR([wrong geoip lib version or lib not found])
+ ],[
+ -L$GEOIP_DIR/$PHP_LIBDIR -lm
+ ])
+
+ # Checking for GeoIP_setup_custom_directory in newer lib
+ PHP_CHECK_LIBRARY($LIBNAME,GeoIP_setup_custom_directory,
+ [
+ AC_DEFINE(HAVE_CUSTOM_DIRECTORY,1,[ ])
+ MIN_GEOIP_VERSION=1004001
+ ],[
+ ],[
+ -L$GEOIP_DIR/$PHP_LIBDIR -lm
+ ])
+
+ # Checking for GeoIP_set_charset in newer lib
+ PHP_CHECK_LIBRARY($LIBNAME,GeoIP_set_charset,
+ [
+ AC_DEFINE(HAVE_SET_CHARSET,1,[ ])
+ MIN_GEOIP_VERSION=1004003
+ ],[
+ ],[
+ -L$GEOIP_DIR/$PHP_LIBDIR -lm
+ ])
+
+ # Checking for GeoIP_continent_by_id in newer lib
+ PHP_CHECK_LIBRARY($LIBNAME,GeoIP_continent_by_id,
+ [
+ AC_DEFINE(HAVE_CONTINENT_BY_ID,1,[ ])
+ MIN_GEOIP_VERSION=1004005
+ ],[
+ ],[
+ -L$GEOIP_DIR/$PHP_LIBDIR -lm
+ ])
+
+ # Check to see if we are using the LGPL library (version 1.4.0 and newer)
+ AC_MSG_CHECKING([for LGPL compatible GeoIP libs])
+ libgeoip_full_version=`find $GEOIP_DIR/$PHP_LIBDIR/ -name libGeoIP.\*.\*.\*.\* | cut -d . -f 2-5 | sort`
+ for lines in $libgeoip_full_version; do
+ ac_IFS=$IFS
+ IFS="."
+ set $lines
+ IFS=$ac_IFS
+ done
+
+ # Version after the suffix (eg: .so.1.4.0)
+ if test "[$]1" = "$SHLIB_SUFFIX_NAME"; then
+ LIBGEOIP_VERSION=`expr [$]2 \* 1000000 + [$]3 \* 1000 + [$]4`
+ # Version before the suffix (eg: 1.4.0.dylib on OS X)
+ else
+ LIBGEOIP_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
+ fi
+
+ # Just in case it didn't work, try alternate method, or fail
+ if test "x$LIBGEOIP_VERSION" = "x"; then
+ AC_MSG_RESULT([cannot detect])
+
+ # Alternate method based on library capabilities (not 100% acurate)
+ AC_MSG_CHECKING([library features to determine version (not acurate)])
+ if test "x$MIN_GEOIP_VERSION" = "x"; then
+ AC_MSG_ERROR([For some reason, libGeoIP is installed, but I cannot determine the version used])
+ else
+ LIBGEOIP_VERSION=$MIN_GEOIP_VERSION
+ fi
+ fi
+
+ if test "$LIBGEOIP_VERSION" -lt "1004000"; then
+ AC_MSG_RESULT([wrong version])
+ AC_MSG_ERROR([You need version 1.4.0 or higher of the C API])
+ else
+ AC_MSG_RESULT([found $LIBGEOIP_VERSION])
+ AC_DEFINE_UNQUOTED(LIBGEOIP_VERSION, $LIBGEOIP_VERSION, [ ])
+ fi
+
+ PHP_SUBST(GEOIP_SHARED_LIBADD)
+
+ PHP_NEW_EXTENSION(geoip, geoip.c, $ext_shared)
+fi
+
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/config.w32
^
|
@@ -0,0 +1,15 @@
+// $Id: config.w32 291389 2009-11-28 17:22:51Z pajoye $
+// vim:ft=javascript
+
+ARG_WITH("geoip", "GeoIP Support", "no");
+
+if (PHP_GEOIP == "yes") {
+ if (CHECK_HEADER_ADD_INCLUDE("geoip.h", "CFLAGS_GEOIP", PHP_GEOIP + ";" + PHP_PHP_BUILD + "\\include\\geoip") &&
+ CHECK_LIB("geoip_a.lib;GeoIP.lib", "geoip", PHP_GEOIP)) {
+ AC_DEFINE('HAVE_GEOIP', 1, 'Have GeoIP support', false);
+ AC_DEFINE('LIBGEOIP_VERSION', 1004006, 'GeoIP Version');
+ EXTENSION("geoip", "geoip.c");
+ } else {
+ WARNING('Could not find geoip.h or geoip lib; skipping');
+ }
+}
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/geoip.c
^
|
@@ -0,0 +1,595 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2009 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Olivier Hill <ohill@php.net> |
+ | Matthew Fonda |
+ +----------------------------------------------------------------------+
+ Please contact support@maxmind.com with any comments
+*/
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <GeoIP.h>
+#include <GeoIPCity.h>
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_geoip.h"
+
+
+
+ZEND_DECLARE_MODULE_GLOBALS(geoip)
+
+static int le_geoip;
+
+/* {{{ */
+zend_function_entry geoip_functions[] = {
+ PHP_FE(geoip_database_info, NULL)
+#define GEOIPDEF(php_func, c_func, db_type) \
+ PHP_FE(php_func, NULL)
+#include "geoip.def"
+#undef GEOIPDEF
+ PHP_FE(geoip_continent_code_by_name, NULL)
+ PHP_FE(geoip_org_by_name, NULL)
+ PHP_FE(geoip_record_by_name, NULL)
+ PHP_FE(geoip_id_by_name, NULL)
+ PHP_FE(geoip_region_by_name, NULL)
+ PHP_FE(geoip_isp_by_name, NULL)
+ PHP_FE(geoip_db_avail, NULL)
+ PHP_FE(geoip_db_get_all_info, NULL)
+ PHP_FE(geoip_db_filename, NULL)
+#if LIBGEOIP_VERSION >= 1004001
+ PHP_FE(geoip_region_name_by_code, NULL)
+ PHP_FE(geoip_time_zone_by_country_and_region, NULL)
+#endif
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ geoip_module_entry
+ */
+zend_module_entry geoip_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
+ "geoip",
+ geoip_functions,
+ PHP_MINIT(geoip),
+ PHP_MSHUTDOWN(geoip),
+ PHP_RINIT(geoip),
+ PHP_RSHUTDOWN(geoip),
+ PHP_MINFO(geoip),
+#if ZEND_MODULE_API_NO >= 20010901
+ PHP_GEOIP_VERSION, /* version number of the extension */
+#endif
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_GEOIP
+ZEND_GET_MODULE(geoip)
+#endif
+
+/* {{{ 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)
+#endif
+PHP_INI_END()
+/* }}} */
+
+/* {{{ php_geoip_init_globals
+ */
+static void php_geoip_init_globals(zend_geoip_globals *geoip_globals)
+{
+ geoip_globals->custom_directory = NULL;
+}
+/* }}} */
+
+/* {{{ PHP_MINIT_FUNCTION
+ */
+PHP_MINIT_FUNCTION(geoip)
+{
+ ZEND_INIT_MODULE_GLOBALS(geoip, php_geoip_init_globals, NULL);
+ REGISTER_INI_ENTRIES();
+
+ /* @TODO: Do something for custom_directory before initialization here */
+
+#ifdef HAVE_CUSTOM_DIRECTORY
+ GeoIP_setup_custom_directory(GEOIP_G(custom_directory));
+#endif
+
+ _GeoIP_setup_dbfilename();
+
+ /* For database type constants */
+ REGISTER_LONG_CONSTANT("GEOIP_COUNTRY_EDITION", GEOIP_COUNTRY_EDITION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_REGION_EDITION_REV0", GEOIP_REGION_EDITION_REV0, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_CITY_EDITION_REV0", GEOIP_CITY_EDITION_REV0, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_ORG_EDITION", GEOIP_ORG_EDITION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_ISP_EDITION", GEOIP_ISP_EDITION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_CITY_EDITION_REV1", GEOIP_CITY_EDITION_REV1, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_REGION_EDITION_REV1", GEOIP_REGION_EDITION_REV1, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_PROXY_EDITION", GEOIP_PROXY_EDITION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_ASNUM_EDITION", GEOIP_ASNUM_EDITION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_NETSPEED_EDITION", GEOIP_NETSPEED_EDITION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_DOMAIN_EDITION", GEOIP_DOMAIN_EDITION, CONST_CS | CONST_PERSISTENT);
+
+ /* For netspeed constants */
+ REGISTER_LONG_CONSTANT("GEOIP_UNKNOWN_SPEED", GEOIP_UNKNOWN_SPEED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_DIALUP_SPEED", GEOIP_DIALUP_SPEED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_CABLEDSL_SPEED", GEOIP_CABLEDSL_SPEED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GEOIP_CORPORATE_SPEED", GEOIP_CORPORATE_SPEED, CONST_CS | CONST_PERSISTENT);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(geoip)
+{
+ return SUCCESS;
+}
+/* }}} */
+
+
+/* {{{ PHP_RINIT_FUNCTION
+ */
+PHP_RINIT_FUNCTION(geoip)
+{
+ return SUCCESS;
+}
+/* }}} */
+
+
+/* {{{ PHP_RSHUTDOWN_FUNCTION
+ */
+PHP_RSHUTDOWN_FUNCTION(geoip)
+{
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(geoip)
+{
+ char buf[32];
+
+ php_info_print_table_start();
+ php_info_print_table_header(2, "geoip support", "enabled");
+ php_info_print_table_row(2, "geoip extension version", PHP_GEOIP_VERSION);
+ snprintf(buf, sizeof(buf), "%d", LIBGEOIP_VERSION);
+ php_info_print_table_row(2, "geoip library version", buf);
+ php_info_print_table_end();
+ DISPLAY_INI_ENTRIES();
+}
+/* }}} */
+
+/* {{{ proto boolean geoip_db_avail( [ int database ] ) */
+PHP_FUNCTION(geoip_db_avail)
+{
+ long edition;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &edition) == FAILURE) {
+ return;
+ }
+
+ if (edition < 0 || edition >= NUM_DB_TYPES)
+ {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database type given is out of bound.");
+ return;
+ }
+
+ RETURN_BOOL(GeoIP_db_avail(edition));
+}
+/* }}} */
+
+/* {{{ proto string geoip_db_filename( [ int database ] ) */
+PHP_FUNCTION(geoip_db_filename)
+{
+ long edition;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &edition) == FAILURE) {
+ return;
+ }
+
+ if (edition < 0 || edition >= NUM_DB_TYPES)
+ {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database type given is out of bound.");
+ return;
+ }
+
+ if (NULL != GeoIPDBFileName[edition])
+ RETURN_STRING(GeoIPDBFileName[edition], 1);
+}
+/* }}} */
+
+/* {{{ proto array geoip_db_get_all_info( ) */
+PHP_FUNCTION(geoip_db_get_all_info)
+{
+ int i;
+
+ array_init(return_value);
+
+ for (i=0; i < NUM_DB_TYPES; i++)
+ {
+ if (NULL != GeoIPDBDescription[i])
+ {
+ zval *row;
+ ALLOC_INIT_ZVAL(row);
+ array_init(row);
+
+ add_assoc_bool(row, "available", GeoIP_db_avail(i));
+ add_assoc_string(row, "description", (char *)GeoIPDBDescription[i], 1);
+ if (GeoIPDBFileName[i]) {
+ add_assoc_string(row, "filename", GeoIPDBFileName[i], 1);
+ }
+
+ add_index_zval(return_value, i, row);
+ }
+ }
+}
+/* }}} */
+
+/* {{{ proto string geoip_database_info( [ int database ] )
+ Returns GeoIP Database information */
+PHP_FUNCTION(geoip_database_info)
+{
+ GeoIP * gi;
+ char * db_info;
+ long edition = GEOIP_COUNTRY_EDITION;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &edition) == FAILURE) {
+ return;
+ }
+
+ if (edition < 0 || edition >= NUM_DB_TYPES)
+ {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database type given is out of bound.");
+ return;
+ }
+
+ if (GeoIP_db_avail(edition)) {
+ gi = GeoIP_open_type(edition, GEOIP_STANDARD);
+ } else {
+ if (NULL != GeoIPDBFileName[edition])
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
+ else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available.");
+ return;
+ }
+
+ db_info = GeoIP_database_info(gi);
+ GeoIP_delete(gi);
+
+ RETVAL_STRING(db_info, 1);
+ free(db_info);
+}
+/* }}} */
+
+/* {{{ */
+#define GEOIPDEF(php_func, c_func, db_type) \
+ PHP_FUNCTION(php_func) \
+ { \
+ GeoIP * gi; \
+ char * hostname = NULL; \
+ const char * return_code; \
+ int arglen; \
+ \
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) { \
+ return; \
+ } \
+ \
+ if (GeoIP_db_avail(db_type)) { \
+ gi = GeoIP_open_type(db_type, GEOIP_STANDARD); \
+ } else { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[db_type]); \
+ return; \
+ } \
+ \
+ return_code = c_func(gi, hostname); \
+ GeoIP_delete(gi); \
+ if (return_code == NULL) { \
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname); \
+ RETURN_FALSE; \
+ } \
+ RETURN_STRING((char*)return_code, 1); \
+ \
+ }
+#include "geoip.def"
+#undef GEOIPDEF
+/* }}} */
+
+/* {{{ proto string geoip_continent_code_by_name( string hostname )
+ Returns the Continent name found in the GeoIP Database */
+PHP_FUNCTION(geoip_continent_code_by_name)
+{
+ GeoIP * gi;
+ char * hostname = NULL;
+ int id;
+ int arglen;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
+ return;
+ }
+
+ if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION)) {
+ gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
+ return;
+ }
+
+ id = GeoIP_id_by_name(gi, hostname);
+ GeoIP_delete(gi);
+ if (id == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
+ RETURN_FALSE;
+ }
+ RETURN_STRING((char *)GeoIP_country_continent[id], 1);
+}
+/* }}} */
+
+/* {{{ proto string geoip_org_by_name( string hostname )
+ Returns the Organization Name found in the GeoIP Database */
+PHP_FUNCTION(geoip_org_by_name)
+{
+ GeoIP * gi;
+ char * hostname = NULL;
+ char * org;
+ int arglen;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
+ return;
+ }
+
+ if (GeoIP_db_avail(GEOIP_ORG_EDITION)) {
+ gi = GeoIP_open_type(GEOIP_ORG_EDITION, GEOIP_STANDARD);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_ORG_EDITION]);
+ return;
+ }
+
+ org = GeoIP_org_by_name(gi, hostname);
+ GeoIP_delete(gi);
+ if (org == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
+ RETURN_FALSE;
+ }
+ RETVAL_STRING(org, 1);
+ free(org);
+}
+/* }}} */
+
+/* {{{ proto array geoip_record_by_name( string hostname )
+ Returns the detailed City information found in the GeoIP Database */
+PHP_FUNCTION(geoip_record_by_name)
+{
+ GeoIP * gi;
+ char * hostname = NULL;
+ int arglen;
+ GeoIPRecord * gir;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
+ return;
+ }
+
+ if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1) || GeoIP_db_avail(GEOIP_CITY_EDITION_REV0)) {
+ if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1)) {
+ gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV1, GEOIP_STANDARD);
+ } else {
+ gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV0, GEOIP_STANDARD);
+ }
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_CITY_EDITION_REV0]);
+ return;
+ }
+ gir = GeoIP_record_by_name(gi, hostname);
+
+ GeoIP_delete(gi);
+
+ if (NULL == gir) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
+ RETURN_FALSE;
+ }
+
+ array_init(return_value);
+#if LIBGEOIP_VERSION >= 1004003
+ add_assoc_string(return_value, "continent_code", (gir->continent_code == NULL) ? "" : gir->continent_code, 1);
+#endif
+ add_assoc_string(return_value, "country_code", (gir->country_code == NULL) ? "" : gir->country_code, 1);
+ add_assoc_string(return_value, "country_code3", (gir->country_code3 == NULL) ? "" : gir->country_code3, 1);
+ add_assoc_string(return_value, "country_name", (gir->country_name == NULL) ? "" : gir->country_name, 1);
+ add_assoc_string(return_value, "region", (gir->region == NULL) ? "" : gir->region, 1);
+ add_assoc_string(return_value, "city", (gir->city == NULL) ? "" : gir->city, 1);
+ add_assoc_string(return_value, "postal_code", (gir->postal_code == NULL) ? "" : gir->postal_code, 1);
+ add_assoc_double(return_value, "latitude", gir->latitude);
+ add_assoc_double(return_value, "longitude", gir->longitude);
+#if LIBGEOIP_VERSION >= 1004005
+ add_assoc_long(return_value, "dma_code", gir->metro_code);
+#else
+ add_assoc_long(return_value, "dma_code", gir->dma_code);
+#endif
+ add_assoc_long(return_value, "area_code", gir->area_code);
+
+ GeoIPRecord_delete(gir);
+}
+/* }}} */
+
+/* {{{ proto integer geoip_id_by_name( string hostname )
+ Returns the Net Speed found in the GeoIP Database */
+PHP_FUNCTION(geoip_id_by_name)
+{
+ GeoIP * gi;
+ char * hostname = NULL;
+ int arglen;
+ int netspeed;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
+ return;
+ }
+
+ if (GeoIP_db_avail(GEOIP_NETSPEED_EDITION)) {
+ gi = GeoIP_open_type(GEOIP_NETSPEED_EDITION, GEOIP_STANDARD);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_NETSPEED_EDITION]);
+ return;
+ }
+
+ netspeed = GeoIP_id_by_name(gi, hostname);
+ GeoIP_delete(gi);
+ RETURN_LONG(netspeed);
+}
+/* }}} */
+
+/* {{{ proto array geoip_region_by_name( string hostname )
+ Returns the Country Code and region found in the GeoIP Database */
+PHP_FUNCTION(geoip_region_by_name)
+{
+ GeoIP * gi;
+ char * hostname = NULL;
+ int arglen;
+ GeoIPRegion * region;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
+ return;
+ }
+
+ if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV0) || GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) {
+ if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) {
+ gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV1, GEOIP_STANDARD);
+ } else {
+ gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV0, GEOIP_STANDARD);
+ }
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_REGION_EDITION_REV0]);
+ return;
+ }
+
+ region = GeoIP_region_by_name(gi, hostname);
+ GeoIP_delete(gi);
+
+ if (NULL == region) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
+ RETURN_FALSE;
+ }
+
+ array_init(return_value);
+ add_assoc_string(return_value, "country_code", region->country_code, 1);
+ add_assoc_string(return_value, "region", region->region, 1);
+
+ GeoIPRegion_delete(region);
+}
+/* }}} */
+
+/* {{{ proto string geoip_isp_by_name( string hostname )
+ Returns the ISP Name found in the GeoIP Database */
+PHP_FUNCTION(geoip_isp_by_name)
+{
+ GeoIP * gi;
+ char * hostname = NULL;
+ char * isp;
+ int arglen;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
+ return;
+ }
+
+ if (GeoIP_db_avail(GEOIP_ISP_EDITION)) {
+ gi = GeoIP_open_type(GEOIP_ISP_EDITION, GEOIP_STANDARD);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_ISP_EDITION]);
+ return;
+ }
+
+ isp = GeoIP_name_by_name(gi, hostname);
+ GeoIP_delete(gi);
+ if (isp == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Host %s not found", hostname);
+ RETURN_FALSE;
+ }
+ RETVAL_STRING(isp, 1);
+ free(isp);
+}
+
+#if LIBGEOIP_VERSION >= 1004001
+/* {{{ proto string geoip_region_name_by_code( string country_code, string region_code )
+ Returns the region name for some country code and region code combo */
+PHP_FUNCTION(geoip_region_name_by_code)
+{
+ char * country_code = NULL;
+ char * region_code = NULL;
+ const char * region_name;
+ int countrylen, regionlen;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &country_code, &countrylen, ®ion_code, ®ionlen) == FAILURE) {
+ return;
+ }
+
+ if (!countrylen || !regionlen) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You need to specify the country and region codes.");
+ RETURN_FALSE;
+ }
+
+ region_name = GeoIP_region_name_by_code(country_code, region_code);
+ if (region_name == NULL) {
+ RETURN_FALSE;
+ }
+ RETURN_STRING((char*)region_name, 1);
+}
+/* }}} */
+#endif
+
+#if LIBGEOIP_VERSION >= 1004001
+/* {{{ proto string geoip_time_zone_by_country_and_region( string country, string region )
+ Returns the time zone for some country code and region code combo */
+PHP_FUNCTION(geoip_time_zone_by_country_and_region)
+{
+ char * country = NULL;
+ char * region = NULL;
+ const char * timezone;
+ int countrylen, arg2len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &country, &countrylen, ®ion, &arg2len) == FAILURE) {
+ return;
+ }
+
+ if (!countrylen) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You need to specify at least the country code.");
+ RETURN_FALSE;
+ }
+
+ timezone = GeoIP_time_zone_by_country_and_region(country, region);
+ if (timezone == NULL) {
+ RETURN_FALSE;
+ }
+ RETURN_STRING((char*)timezone, 1);
+}
+/* }}} */
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/geoip.def
^
|
@@ -0,0 +1,28 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 2002-2009 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Olivier Hill <ohill@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* GEOIPDEF(php_func, c_func, db_type) */
+GEOIPDEF(geoip_country_code_by_name, GeoIP_country_code_by_name, GEOIP_COUNTRY_EDITION)
+GEOIPDEF(geoip_country_code3_by_name, GeoIP_country_code3_by_name, GEOIP_COUNTRY_EDITION)
+GEOIPDEF(geoip_country_name_by_name, GeoIP_country_name_by_name, GEOIP_COUNTRY_EDITION)
+
+#if LIBGEOIP_VERSION >= 1004005 && FALSE
+GEOIPDEF(geoip_country_code_by_name_v6, GeoIP_country_code_by_name_v6, GEOIP_COUNTRY_EDITION_V6)
+GEOIPDEF(geoip_country_code3_by_name_v6, GeoIP_country_code3_by_name_v6, GEOIP_COUNTRY_EDITION_V6)
+GEOIPDEF(geoip_country_name_by_name_v6, GeoIP_country_name_by_name_v6, GEOIP_COUNTRY_EDITION_V6)
+#endif
\ No newline at end of file
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/php_geoip.h
^
|
@@ -0,0 +1,88 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2009 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Olivier Hill <ohill@php.net> |
+ | Matthew Fonda |
+ +----------------------------------------------------------------------+
+ Please contact support@maxmind.com with any comments
+*/
+
+#ifndef PHP_GEOIP_H
+#define PHP_GEOIP_H
+
+extern zend_module_entry geoip_module_entry;
+#define phpext_geoip_ptr &geoip_module_entry
+
+#define PHP_GEOIP_VERSION "1.0.8"
+
+#ifdef PHP_WIN32
+#define PHP_GEOIP_API __declspec(dllexport)
+#else
+#define PHP_GEOIP_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+#include <GeoIP.h>
+#include <GeoIPCity.h>
+
+PHP_MINIT_FUNCTION(geoip);
+PHP_MSHUTDOWN_FUNCTION(geoip);
+PHP_RINIT_FUNCTION(geoip);
+PHP_RSHUTDOWN_FUNCTION(geoip);
+PHP_MINFO_FUNCTION(geoip);
+
+
+PHP_FUNCTION(geoip_database_info);
+#define GEOIPDEF(php_func, c_func, db_type) \
+PHP_FUNCTION(php_func);
+#include "geoip.def"
+#undef GEOIPDEF
+PHP_FUNCTION(geoip_continent_code_by_name);
+PHP_FUNCTION(geoip_org_by_name);
+PHP_FUNCTION(geoip_record_by_name);
+PHP_FUNCTION(geoip_id_by_name);
+PHP_FUNCTION(geoip_region_by_name);
+PHP_FUNCTION(geoip_isp_by_name);
+PHP_FUNCTION(geoip_db_avail);
+PHP_FUNCTION(geoip_db_get_all_info);
+PHP_FUNCTION(geoip_db_filename);
+#if LIBGEOIP_VERSION >= 1004001
+PHP_FUNCTION(geoip_region_name_by_code);
+PHP_FUNCTION(geoip_time_zone_by_country_and_region);
+#endif
+
+ZEND_BEGIN_MODULE_GLOBALS(geoip)
+ char* custom_directory;
+ZEND_END_MODULE_GLOBALS(geoip)
+
+#ifdef ZTS
+#define GEOIP_G(v) TSRMG(geoip_globals_id, zend_geoip_globals *, v)
+#else
+#define GEOIP_G(v) (geoip_globals.v)
+#endif
+
+#endif /* PHP_GEOIP_H */
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/001.phpt
^
|
(renamed from geoip-1.0.5/tests/001.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/001.phpt
^
|
(renamed from geoip-1.0.5/tests/001.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/002.phpt
^
|
(renamed from geoip-1.0.5/tests/002.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/002.phpt
^
|
(renamed from geoip-1.0.5/tests/002.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/003.phpt
^
|
(renamed from geoip-1.0.5/tests/003.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/003.phpt
^
|
(renamed from geoip-1.0.5/tests/003.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/004.phpt
^
|
(renamed from geoip-1.0.5/tests/004.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/004.phpt
^
|
(renamed from geoip-1.0.5/tests/004.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/005.phpt
^
|
(renamed from geoip-1.0.5/tests/005.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/005.phpt
^
|
(renamed from geoip-1.0.5/tests/005.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/006.phpt
^
|
(renamed from geoip-1.0.5/tests/006.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/006.phpt
^
|
(renamed from geoip-1.0.5/tests/006.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/007.phpt
^
|
(renamed from geoip-1.0.5/tests/007.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/007.phpt
^
|
(renamed from geoip-1.0.5/tests/007.phpt)
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/tests/008.phpt
^
|
@@ -0,0 +1,12 @@
+--TEST--
+Calling geoip_db_filename() with a non-existant database type within bound.
+--SKIPIF--
+<?php if (!extension_loaded("geoip")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump( geoip_db_filename(0) );
+
+?>
+--EXPECT--
+NULL
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/tests/009.phpt
^
|
@@ -0,0 +1,12 @@
+--TEST--
+Calling geoip_db_avail() with a non-existant database type within bound.
+--SKIPIF--
+<?php if (!extension_loaded("geoip")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump( geoip_db_avail(0) );
+
+?>
+--EXPECT--
+bool(false)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/010.phpt
^
|
(renamed from geoip-1.0.5/tests/010.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/010.phpt
^
|
(renamed from geoip-1.0.5/tests/010.phpt)
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/tests/011.phpt
^
|
@@ -0,0 +1,12 @@
+--TEST--
+Calling geoip_database_info() with a non-existant database type within bound.
+--SKIPIF--
+<?php if (!extension_loaded("geoip")) print "skip"; ?>
+--FILE--
+<?php
+
+geoip_database_info(0);
+
+?>
+--EXPECTF--
+Warning: geoip_database_info(): Required database not available. in %s on line %d
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/tests/013.phpt
^
|
@@ -0,0 +1,15 @@
+--TEST--
+Checking timezone info
+--SKIPIF--
+<?php if (!extension_loaded("geoip")) print "skip"; ?>
+--POST--
+--GET--
+--FILE--
+<?php
+
+var_dump(geoip_time_zone_by_country_and_region('CA','QC'));
+var_dump(geoip_time_zone_by_country_and_region('JP','01'));
+?>
+--EXPECT--
+string(16) "America/Montreal"
+string(10) "Asia/Tokyo"
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/014.phpt
^
|
(renamed from geoip-1.0.5/tests/014.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/014.phpt
^
|
(renamed from geoip-1.0.5/tests/014.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/015.phpt
^
|
(renamed from geoip-1.0.5/tests/015.phpt)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/geoip-1.0.8/tests/015.phpt
^
|
(renamed from geoip-1.0.5/tests/015.phpt)
|
[-]
[+]
|
Added |
geoip-1.0.8.tgz/geoip-1.0.8/tests/016.phpt
^
|
@@ -0,0 +1,32 @@
+--TEST--
+Checking geoip_region_name_by_code with (some) empty fields
+--SKIPIF--
+<?php if (!extension_loaded("geoip")) print "skip"; ?>
+--POST--
+--GET--
+--FILE--
+<?php
+
+var_dump(geoip_region_name_by_code('CA',''));
+var_dump(geoip_region_name_by_code('CA',NULL));
+var_dump(geoip_region_name_by_code('CA',1));
+var_dump(geoip_region_name_by_code('','QC'));
+var_dump(geoip_region_name_by_code(NULL,'QC'));
+var_dump(geoip_region_name_by_code(1,'QC'));
+
+?>
+--EXPECTF--
+
+Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
+bool(false)
+
+Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
+bool(false)
+bool(false)
+
+Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
+bool(false)
+
+Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
+bool(false)
+bool(false)
|
[-]
[+]
|
Changed |
geoip-1.0.8.tgz/package.xml
^
|
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.6.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+<package packagerversion="1.8.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>geoip</name>
<channel>pecl.php.net</channel>
<summary>Map IP address to geographic places</summary>
@@ -10,10 +10,10 @@
<email>ohill@php.net</email>
<active>yes</active>
</lead>
- <date>2008-12-19</date>
- <time>14:31:33</time>
+ <date>2011-10-23</date>
+ <time>20:37:20</time>
<version>
- <release>1.0.5</release>
+ <release>1.0.8</release>
<api>1.0.3</api>
</version>
<stability>
@@ -21,7 +21,12 @@
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
- <notes>* Small bug in phpinfo() when printing version number could crash PHP.</notes>
+ <notes>
+* Windows support
+* Fix segfault with newer geoip libraries and geoip_db_get_all_info() (bug #60066)
+* Use X-Macros for repeated code
+* Updated tests
+ </notes>
<contents>
<dir name="/">
<file md5sum="b06052cd0a4e66132e1bcc98c5739ecd" name="tests/001.phpt" role="test" />
@@ -31,18 +36,20 @@
<file md5sum="36160cb94ff89f1cf2bf6b0ca445ed59" name="tests/005.phpt" role="test" />
<file md5sum="916fd2691a419719349ca441e4a13ba7" name="tests/006.phpt" role="test" />
<file md5sum="ac7f1f611cf80ab6bc19dcdc08ed3004" name="tests/007.phpt" role="test" />
- <file md5sum="15512214adb247c86d577764f70419af" name="tests/008.phpt" role="test" />
- <file md5sum="d7ac6c1ef8bfea62142dbbba2e33d150" name="tests/009.phpt" role="test" />
+ <file md5sum="39ce54b6a82f868014f793089f39d5aa" name="tests/008.phpt" role="test" />
+ <file md5sum="1bcfeedd5c5910f972cfc354f34edfe5" name="tests/009.phpt" role="test" />
<file md5sum="7ce6f4ed5737f65dab3f0b7771856712" name="tests/010.phpt" role="test" />
- <file md5sum="d636093e2a76993c2a3d76c6f5d45bc4" name="tests/011.phpt" role="test" />
- <file md5sum="8fcceb7a84f98c8086227222281fd1ba" name="tests/013.phpt" role="test" />
+ <file md5sum="3fa19d6f77d2158c3780f03ca3e964b3" name="tests/011.phpt" role="test" />
+ <file md5sum="9b71da0d066ed2eef0fb6971ce69ab89" name="tests/013.phpt" role="test" />
<file md5sum="7a2b0ee9a1b27a66759b5489a22b51a6" name="tests/014.phpt" role="test" />
<file md5sum="678e4965f7b7a797f7563e76958b9afd" name="tests/015.phpt" role="test" />
- <file md5sum="674d21ce05d719107c93bea3a762c7b8" name="tests/016.phpt" role="test" />
- <file md5sum="b1d313d13f0a22c493947d414f3c2282" name="ChangeLog" role="doc" />
- <file md5sum="da493a91c105b72ed17dccd59edbd7e9" name="config.m4" role="src" />
- <file md5sum="7261673d0b1669ee5424d15bb092086e" name="geoip.c" role="src" />
- <file md5sum="781e00d17f86ddc0d37c337eb6dcb102" name="php_geoip.h" role="src" />
+ <file md5sum="726935ffc75d98b0e051f035a192dbd2" name="tests/016.phpt" role="test" />
+ <file md5sum="17da62b01fcc77666fc9f714ec5d12d1" name="ChangeLog" role="doc" />
+ <file md5sum="4c33bee83fa1a6c0b107c074f64f603c" name="config.m4" role="src" />
+ <file md5sum="bf5bf812961c9c182089e2226408c60e" name="config.w32" role="src" />
+ <file md5sum="6c9de7dfcd21ad8c763cc4fc3395e051" name="geoip.def" role="src" />
+ <file md5sum="12b6d3c65c03bb1da615c81287627228" name="geoip.c" role="src" />
+ <file md5sum="b937c144aca25464132abe7bec753e07" name="php_geoip.h" role="src" />
<file md5sum="00add03af2620b8c9b64106f6178d866" name="README" role="doc" />
</dir>
</contents>
@@ -61,6 +68,71 @@
<changelog>
<release>
<version>
+ <release>1.0.8</release>
+ <api>1.0.3</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2011-10-23</date>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>
+* Windows support
+* Fix segfault with newer geoip libraries and geoip_db_get_all_info() (bug #60066)
+* Use X-Macros for repeated code
+* Updated tests
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.0.7</release>
+ <api>1.0.3</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2009-03-11</date>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>
+* Do not issue a NOTICE when values don't exist for timezone and region name (as added in 1.0.4)
+* Fix a compile issue on FreeBSD
+* Try to be bulletproof on library features detection.
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.0.6</release>
+ <api>1.0.3</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2009-01-20</date>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>
+* Fixing compile bug when multiple GeoIP libs are installed, bug #15372.
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.0.5</release>
+ <api>1.0.3</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2008-12-19</date>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>
+* Small bug in phpinfo() when printing version number could crash PHP.
+ </notes>
+ </release>
+ <release>
+ <version>
<release>1.0.4</release>
<api>1.0.3</api>
</version>
@@ -70,10 +142,12 @@
</stability>
<date>2008-12-19</date>
<license uri="http://www.php.net/license">PHP License</license>
- <notes>* Fix memleaks, bug #14851
+ <notes>
+* Fix memleaks, bug #14851
* Small patch for MacPorts by jhohle
* Add geoip_time_zone_by_country_and_region() and geoip_region_name_by_code() (thanks to Sid Dunayer)
-* Add continent_code field for City Database, only if using GeoIP lib 1.4.3 or newer</notes>
+* Add continent_code field for City Database, only if using GeoIP lib 1.4.3 or newer
+ </notes>
</release>
<release>
<version>
@@ -86,10 +160,12 @@
</stability>
<date>2008-06-12</date>
<license uri="http://www.php.net/license">PHP License</license>
- <notes>* Change license from PHP 3.0 to PHP 3.01 for Debian?
+ <notes>
+* Change license from PHP 3.0 to PHP 3.01 for Debian?
* Added geoip_continent_code_by_name() to get continent instead of country
* Fixing a small casting issue (compiler warning)
-* Fixing missing entries in geoip_record_by_name(), bug #14131</notes>
+* Fixing missing entries in geoip_record_by_name(), bug #14131
+ </notes>
</release>
<release>
<version>
@@ -102,7 +178,9 @@
</stability>
<date>2007-11-20</date>
<license uri="http://www.php.net/license">PHP</license>
- <notes>* Added geoip_isp_by_name (patch by Yannick Gard)</notes>
+ <notes>
+* Added geoip_isp_by_name (patch by Yannick Gard)
+ </notes>
</release>
<release>
<version>
@@ -115,12 +193,14 @@
</stability>
<date>2007-08-22</date>
<license uri="http://www.php.net/license">PHP</license>
- <notes>* Added geoip_db_avail() to check for DB availability (file found)
+ <notes>
+* Added geoip_db_avail() to check for DB availability (file found)
* Added geoip_db_filename() to get the internal file name of the library
* Added geoip_db_get_all_info() to fetch all info about all database types
* Added some tests so that make test can crunch something.
* Added database file path and name in warning when DB is not found.
-* Added geoip.custom_directory php.ini option to change default path for DBs</notes>
+* Added geoip.custom_directory php.ini option to change default path for DBs
+ </notes>
</release>
<release>
<version>
@@ -133,8 +213,10 @@
</stability>
<date>2007-08-14</date>
<license uri="http://www.php.net/license">PHP</license>
- <notes>* Marked as stable
-* Fixing wrong version number inside extension</notes>
+ <notes>
+* Marked as stable
+* Fixing wrong version number inside extension
+ </notes>
</release>
<release>
<version>
@@ -147,7 +229,9 @@
</stability>
<date>2006-08-22</date>
<license uri="http://www.php.net/license">PHP</license>
- <notes>Initial PECL release</notes>
+ <notes>
+Initial PECL release
+ </notes>
</release>
</changelog>
</package>
|
[-]
[+]
|
Deleted |
package.xml
^
|
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.7.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>geoip</name>
- <channel>pecl.php.net</channel>
- <summary>Map IP address to geographic places</summary>
- <description>This PHP extension allows you to find the location of an IP address - City, State, Country, Longitude, Latitude, and other information as all, such as ISP and connection type. For more info, please visit Maxmind's website.</description>
- <lead>
- <name>Olivier Hill</name>
- <user>ohill</user>
- <email>ohill@php.net</email>
- <active>yes</active>
- </lead>
- <date>2009-03-11</date>
- <time>13:43:29</time>
- <version>
- <release>1.0.7</release>
- <api>1.0.3</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>* Do not issue a NOTICE when values don't exist for timezone and region name (as added in 1.0.4)
-* Fix a compile issue on FreeBSD
-* Try to be bulletproof on library features detection.</notes>
- <contents>
- <dir name="/">
- <file md5sum="b06052cd0a4e66132e1bcc98c5739ecd" name="tests/001.phpt" role="test" />
- <file md5sum="5756f1cfb634d23c765435f57b5b9575" name="tests/002.phpt" role="test" />
- <file md5sum="9349f89dbad73a1ce171100f186a3f4a" name="tests/003.phpt" role="test" />
- <file md5sum="48573355b6270090878243065e03dc12" name="tests/004.phpt" role="test" />
- <file md5sum="36160cb94ff89f1cf2bf6b0ca445ed59" name="tests/005.phpt" role="test" />
- <file md5sum="916fd2691a419719349ca441e4a13ba7" name="tests/006.phpt" role="test" />
- <file md5sum="ac7f1f611cf80ab6bc19dcdc08ed3004" name="tests/007.phpt" role="test" />
- <file md5sum="15512214adb247c86d577764f70419af" name="tests/008.phpt" role="test" />
- <file md5sum="d7ac6c1ef8bfea62142dbbba2e33d150" name="tests/009.phpt" role="test" />
- <file md5sum="7ce6f4ed5737f65dab3f0b7771856712" name="tests/010.phpt" role="test" />
- <file md5sum="d636093e2a76993c2a3d76c6f5d45bc4" name="tests/011.phpt" role="test" />
- <file md5sum="9b71da0d066ed2eef0fb6971ce69ab89" name="tests/013.phpt" role="test" />
- <file md5sum="7a2b0ee9a1b27a66759b5489a22b51a6" name="tests/014.phpt" role="test" />
- <file md5sum="678e4965f7b7a797f7563e76958b9afd" name="tests/015.phpt" role="test" />
- <file md5sum="726935ffc75d98b0e051f035a192dbd2" name="tests/016.phpt" role="test" />
- <file md5sum="17da62b01fcc77666fc9f714ec5d12d1" name="ChangeLog" role="doc" />
- <file md5sum="d67a36bba90a60933304e2214164500d" name="config.m4" role="src" />
- <file md5sum="5f5b4a0637cb8be6f57b5040ee52cc86" name="geoip.c" role="src" />
- <file md5sum="d8f810b598698f00ec59637935baa266" name="php_geoip.h" role="src" />
- <file md5sum="00add03af2620b8c9b64106f6178d866" name="README" role="doc" />
- </dir>
- </contents>
- <dependencies>
- <required>
- <php>
- <min>4.3.0</min>
- </php>
- <pearinstaller>
- <min>1.4.0b1</min>
- </pearinstaller>
- </required>
- </dependencies>
- <providesextension>geoip</providesextension>
- <extsrcrelease />
- <changelog>
- <release>
- <version>
- <release>1.0.7</release>
- <api>1.0.3</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2009-03-11</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>* Do not issue a NOTICE when values don't exist for timezone and region name (as added in 1.0.4)
-* Fix a compile issue on FreeBSD
-* Try to be bulletproof on library features detection.</notes>
- </release>
- <release>
- <version>
- <release>1.0.6</release>
- <api>1.0.3</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2009-01-20</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>* Fixing compile bug when multiple GeoIP libs are installed, bug #15372.</notes>
- </release>
- <release>
- <version>
- <release>1.0.5</release>
- <api>1.0.3</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2008-12-19</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>* Small bug in phpinfo() when printing version number could crash PHP.</notes>
- </release>
- <release>
- <version>
- <release>1.0.4</release>
- <api>1.0.3</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2008-12-19</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>* Fix memleaks, bug #14851
-* Small patch for MacPorts by jhohle
-* Add geoip_time_zone_by_country_and_region() and geoip_region_name_by_code() (thanks to Sid Dunayer)
-* Add continent_code field for City Database, only if using GeoIP lib 1.4.3 or newer</notes>
- </release>
- <release>
- <version>
- <release>1.0.3</release>
- <api>1.0.3</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2008-06-12</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>* Change license from PHP 3.0 to PHP 3.01 for Debian?
-* Added geoip_continent_code_by_name() to get continent instead of country
-* Fixing a small casting issue (compiler warning)
-* Fixing missing entries in geoip_record_by_name(), bug #14131</notes>
- </release>
- <release>
- <version>
- <release>1.0.2</release>
- <api>1.0.2</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-11-20</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>* Added geoip_isp_by_name (patch by Yannick Gard)</notes>
- </release>
- <release>
- <version>
- <release>1.0.1</release>
- <api>1.0.1</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-08-22</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>* Added geoip_db_avail() to check for DB availability (file found)
-* Added geoip_db_filename() to get the internal file name of the library
-* Added geoip_db_get_all_info() to fetch all info about all database types
-* Added some tests so that make test can crunch something.
-* Added database file path and name in warning when DB is not found.
-* Added geoip.custom_directory php.ini option to change default path for DBs</notes>
- </release>
- <release>
- <version>
- <release>1.0.0</release>
- <api>1.0.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-08-14</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>* Marked as stable
-* Fixing wrong version number inside extension</notes>
- </release>
- <release>
- <version>
- <release>0.2.0</release>
- <api>0.2.0</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2006-08-22</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>Initial PECL release</notes>
- </release>
- </changelog>
-</package>
|