Page MenuHomePhabricator

Investigate porting GeoIP for HHVM or using GeoIP2-php
Open, MediumPublic

Description

Either GeoIP should be ported to HNI (or use ext_zend_compat) or maybe the newer pure PHP GeoIP2 can be used.

The new version has optional C extension (PECL) however, so there would still the choice of whether to port that bit to HNI (4 methods) or not. Not sure if porting is worth it with JITed code though.


Version: 1.23.0
Severity: normal

Details

Reference
bz62990

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:56 AM
bzimport set Reference to bz62990.
bzimport added a subscriber: Unknown Object (MLST).

Also we should find out if anything still uses/needs this too :)

Actually it would probably make more sense to just not use this. There are 3 extensions that use getip_* methods:

aaron@aaron-notebook-hdx:/var/www/CephWiki/core (master)$ grep -r geoip_ extensions/
extensions/DonationInterface/gateway_common/DonationData.php: if ( function_exists( 'geoip_country_code_by_name' ) ) {
extensions/DonationInterface/gateway_common/DonationData.php: $country = @geoip_country_code_by_name( $ip );
extensions/LandingCheck/SpecialLandingCheck.php: if ( !$country && function_exists( 'geoip_country_code_by_name' ) ) {
extensions/LandingCheck/SpecialLandingCheck.php: $country = geoip_country_code_by_name( $ip );
extensions/FundraiserLandingPage/FundraiserRedirector.body.php: if ( function_exists( 'geoip_country_code_by_name' ) ) {
extensions/FundraiserLandingPage/FundraiserRedirector.body.php: $country = geoip_country_code_by_name( $ip );

After discussing this with Ori, we thought it best to just make a GeoIP MediaWiki extension that uses the geo location cookies set by Varnish and exposes a simple PHP class for fetching this info.

Reopening, we need to run geoip as a fallback on donatewiki and paymentswiki when cookies are missing. The HHVM library looks promising, but we would need to write packaging.