Integrate with GeoIP API module

webchick - February 24, 2009 - 23:06
Project:Ad GeoIP
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed
Description

On MaxMind's site they offer a free pure PHP version of their library. It seems like using this instead of requiring a PECL extension etc. would open this module up to a lot more people who don't have that kind of flexibility to monkey around on their servers.

#1

webchick - February 25, 2009 - 02:08
Status:active» needs work

And the answer appears to be... no, not easily. ;)

The first problem is there's no geoip_db_avail() function when you go this route. If I create one manually when that function doesn't exist, something still isn't working quite right because it's not saving the country association.

Here's a very incomplete and terribly crappy patch, but possibly something to start from.

AttachmentSize
ad_geoip-for-wusses-382864-1.patch 3.61 KB

#2

webchick - February 25, 2009 - 05:27
Title:Remove PECL extension/Apache module requirements?» Integrate with GeoIP API module
Status:needs work» active

Oooo. I just found http://drupal.org/project/geoip tonight. This is a much better idea. Basically, remove all of the stuff about checking GeoIP to see if it's installed, maintaining state, etc. and leave it to GeoIP API module to figure out. This module need only worry about the Ad -> GeoIP integration.

The only problem is that the module doesn't yet support city/region levels, which this module does. For my purposes, Country is fine-grained enough, so I'll try and get something working and post back here.

#3

Jeremy - April 17, 2009 - 16:16
Status:active» postponed (maintainer needs more info)

I'm certainly not opposed to seeing the ad_geoip module properly integrated with the geoip module. A couple potential issues:

  • As you've already pointed out, we'd lose functionality. The geoip project evidently only supports the free GeoLite Country database. Until this is solved, I do not see this being a workable solution.
  • The ad_geoip.inc code needs to talk to the GeoIP database without bootstrapping the database. If we have to bootstrap Drupal every time we want to serve an advertisement, performance will drastically suffer.

Once these two issues are solved, I'm all for moving forward with this.

#4

webchick - April 17, 2009 - 16:31

Well, even though the project page says country only, http://drupal.org/node/383086 implies city support was committed, although I admit to not having looked at the code since whenever I posted that issue. :)

Might be worth a look. Also my experience with Roger is he's a very responsive maintainer who would gladly accept patches.

#5

Jeremy - April 17, 2009 - 16:36
Status:postponed (maintainer needs more info)» postponed

Great! It's not clear to me if it also supports the commercial offerings (which are more accurate). And equally important, I do not yet see a solution for my performance concerns: we need to filter/serve advertisements without bootstrapping Drupal.

I'm not opposed to this idea, but it's not a project I'm likely to take on anytime soon as what we currently have works well for my current needs. Sorry. I'm moving into a postponed state, awaiting a patch that addresses all of these concerns.

 
 

Drupal is a registered trademark of Dries Buytaert.