Re: ip-to-country - summary
| From: | Gabor Hojtsy | Date: | Thu, 01 May 2003 11:14:42 +0000 |
| Subject: | Re: ip-to-country - summary | ||
| References: | 1 2 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-17172@lists.php.net to get a copy of this message | ||
Ups, I forgot to attach the script ;) Here it is.
Goba
> > Final DB Update URL:
> >
> >
> > http://www.directi.com/iptocountry/?site=php.net&dbformat=1&lastupdate=0
> >
> > The last updated date of the db is : 1051660800
>
> OK. Here is the code I have written to create an index and search in the
> db. I have cleaned it up, and added some comments. It has a config section
> to configure the db, idx file names indexing granularity and the IP to
> search for. I have tested it in command line, so some hard coded IP
> addresses are provided.
>
> It seems it is much quicker on Linux, then on Windows (or some of my
> rewrites made it speed up). Current speed results are in the 0.002 and 0.01
> seconds range ;)
>
> I'll set up a script on the rsync server to fetch the DB from the above
> URL, and try to make systems guys to put it into cron.
>
> Goba
Attachment: [text/x-csrc] ip-to-country.php
Attachment: [text/x-csrc] ip-to-country.php