Re: pecl dev intro - bob - geoipo
| From: | Bob Majdak Jr | Date: | Mon, 24 Oct 2011 16:54:41 +0000 |
| Subject: | Re: pecl dev intro - bob - geoipo | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-8761@lists.php.net to get a copy of this message | ||
> The changes should be minimal to the existing code but to add OO
> declarations and getthis. See the zip extension for an example of
> sharing the function and method implementation.
is this true when they are not comparable 1:1? Really think about this. I do not believe these
interfaces are compatible in the same module and for *good reason* - take this example;
Current geoip:
$region = geoip_region_by_name($ip);
$timezone =
geoip_time_zone_by_country_and_region($region['region'],$region['country_code']);
This geoipo:
$geo = new GeoIP($ip);
$timezone = $geo->getRegion()->TimeZone;
I have purposely abstracted the need to figure out how to stack function calls to get what you need,
to make the library more user friendly and PHPesque.
If you really think its worth mashing these two together... I just do not believe in it myself.
Oh and then...
> From Ronald Chmara:
> 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.
> From Olivier Hill
> It goes back to the debate of string functions (PHP core)
> should be OO.
>
> Regarding INI option, I was also thinking this yesterday, it should
> also be exposed via a function
Basically, it has been years, and if it is true that you have ignored 3 patches in the past, then
the only reason you thought of it yesterday was because all the sudden it was in danger of being
replaced with something much better. I do not want to replace the current in PECL if i can avoid it.
I currently have mysql and mysqli, geoip and geoipo running and it does not bother me. Though you
know once I migrate my projects off geoip and onto geoipo it will get unloaded from my ini. Is that
the real problem?
Cheers,
bob.
On Oct 24, 2011, at 11:32 AM, Pierre Joye wrote:
> hi,
>
> On Mon, Oct 24, 2011 at 4:20 PM, Bob Majdak Jr <bob@opsat.net> wrote:
>> 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.
>
> Right, that's the main reason why ini settings are not good for such things.
>
>> 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.
>
> The changes should be minimal to the existing code but to add OO
> declarations and getthis. See the zip extension for an example of
> sharing the function and method implementation.
>
> Cheers,
> --
> Pierre
>
> @pierrejoye | http://blog.thepimp.net |
> http://www.libgd.org