Re: pecl dev intro - bob - geoipo
| From: | Bob Majdak Jr | Date: | Mon, 24 Oct 2011 14:20:06 +0000 |
| Subject: | Re: pecl dev intro - bob - geoipo | ||
| References: | 1 2 3 4 5 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-8756@lists.php.net to get a copy of this message | ||
The PHP INI setting does not work if you have one site that has licensed databases and another using
free databases on the same server. If ini_set() would work afte the fact, then maybe, but it does
not. But I am glad after all these years it has come to your attention. I originally was just going
to submit a patch for just that... but.
OOP gives you lots, unless you deny the shift in PHP towards OOP interfaces and code. Ask Elizabeth
I used to hate OOP pretty hard too to write it off with such a generic slight.
I also implemented look up caching so that if someone is dumb looking up the same name over and over
it does not scan the databases over and over. It was an important step for allowing
$object->getRecord()->RegionName followed by $object->getRecord()->CountryCode for
people who do that.
I even fixed my extention to allow both geoip and geoipo to be running at the same time. (just like
mysql and mysqli...) Where originally I was going to have to shaft old users until I discovered the
proper trick to reset the custom directory.
I can submit a patch that would literally 100% of your code with this object, sure. I had to
refactor things to get the features that were needed and I also made the object actually PHPesque
making GeoIP fun to use, versus having to stack weird named functions to get what you want.
--
bob
On Oct 24, 2011, at 7:27 AM, Olivier Hill wrote:
> Hello all,
>
> Since some people have answered first, I can now openly give my opinion ;)
>
> I'm against having that extension into PECL. We already have a PEAR
> extension (which I now have to maintain because the old maintainer
> doesn't have time now to continue the work), and we already have a
> PECL extension that has been stable for years and is readily available
> in most Linux distros.
>
> Regarding point #1, you can configure the data dir, the ini option is
> missing documentation, I should be adding that.
>
> Regarding #2, OO alone doesn't give you much. GeoIP is a very simple
> extension. It goes back to the debate of string functions (PHP core)
> should be OO. Yes it would be nice, no it is far from being necessary.
>
> If an OO interface can be build on top of the current extension, I'm
> willing to accept patches.
>
> If features are missing from the current extension, open bug reports
> and attach patches.
>
> Thanks,
> Olivier
>
> On Mon, Oct 24, 2011 at 6:24 AM, Ronald Chmara <ronabop@gmail.com> wrote:
>> FWIW, this is the third geoip patch I've seen (some official, some
>> not), just to get multiple data directories. Two of those patches go
>> into OO. That being said, I think the two major features are:
>> 1. Multiple directories for data.
>> 2. OO access.
>>
>> We should be able to merge all of this work. We *could* go down the
>> nightmarish mysql road, with many competing patches/libs/interfaces,
>> but that seems stupid and wrong.
>>
>> Can we make just one PECL library? That has both major features?
>>
>> On Mon, Oct 24, 2011 at 1:18 AM, Pierre Joye <pierre.php@gmail.com> wrote:
>>> adding Oliver to the list, as he maintains geoip.
>>>
>>> On Mon, Oct 24, 2011 at 10:17 AM, Pierre Joye <pierre.php@gmail.com> wrote:
>>>> hi,
>>>>
>>>> I was wondering why you could not simply add your work on top on the
>>>> existing extension instead of having two binding for the exact same
>>>> library without specific benefits but an OO interface (db dir is
>>>> easily implemented in current one, and I don't understand the pt. 3 in
>>>> your mail :).
>>>>
>>>> Cheers,
>>>>
>>>> On Thu, Oct 13, 2011 at 12:53 AM, Bob Majdak Jr <bob@opsat.net> wrote:
>>>>>> Before filling out this form, you must write the
>>>>>> public pecl-dev@lists.php.net mailing list and:
>>>>>> * Introduce yourself
>>>>>
>>>>> Hi. I am Bob. I am 25, live in the DFW metroplex of Texas. I have a cat named
>>>>> Sally and she hates my girlfriend. I used to really like Green Day but now I just think they are
>>>>> alright. I already have a php.net SVN account. (bmajdak)
>>>>>
>>>>>
>>>>>
>>>>>> * Introduce your new extension or the extension
>>>>>> you would like to help maintain
>>>>>
>>>>> I have written a new GeoIP module for the MaxMind libgeoip library. This
>>>>> modules differs from the current geoip module in PECL in three fun filled ways:
>>>>>
>>>>> 1) this one is object oriented. $geo = new GeoIP('php.net');
>>>>>
>>>>> 2) mine allows setting custom database directories at will. libgeoip was
>>>>> originally set once and forget, so the original geoip module set them in php.ini and you were stuck.
>>>>> this new module allows you to set your custom directory at run time instead of server wide in the
>>>>> ini. also thanks to advances in libgeoip, it is now possible to change the custom directory at any
>>>>> time during the application run.
>>>>>
>>>>> 3) mine ends in an o. geoipo.
>>>>>
>>>>>
>>>>>
>>>>>> * Link to the code, if applicable
>>>>>
>>>>> Full source:
>>>>> https://github.com/bobmajdakjr/php-geoipo
>>>>>
>>>>> An example of the old module:
>>>>> https://github.com/bobmajdakjr/php-geoipo/blob/master/examples/cmp-region-geoip.php
>>>>>
>>>>> An example of the new module:
>>>>> https://github.com/bobmajdakjr/php-geoipo/blob/master/examples/cmp-region-geoipo.php
>>>>>
>>>>> I need a tester for Windows. I only have OSX, Linux, and FreeBSD at my
>>>>> disposal. It may also need a few tweaks still for thread safety idunno. But it works great on my CLI
>>>>> and prefork Apaches.
>>>>>
>>>>>
>>>>>
>>>>> love, bob.
>>>>> --
>>>>> PECL development discussion Mailing List (http://pecl.php.net/)
>>>>> To unsubscribe, visit:
>>>>> http://www.php.net/unsub.php
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Pierre
>>>>
>>>> @pierrejoye | http://blog.thepimp.net |
>>>> http://www.libgd.org
>>>>
>>>
>>>
>>>
>>> --
>>> Pierre
>>>
>>> @pierrejoye | http://blog.thepimp.net |
>>> http://www.libgd.org
>>>
>>> --
>>> PECL development discussion Mailing List (http://pecl.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>
>
>
> --
> http://www.olivierhill.ca/