Re: MySQLi Compat question

From: Date: Mon, 09 Jun 2003 22:30:00 +0000
Subject: Re: MySQLi Compat question
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17228@lists.php.net to get a copy of this message
On Monday, June 9, 2003, at 05:41 PM, John Coggeshall wrote:
On Mon, 2003-06-09 at 14:32, George Schlossnagle wrote:
I'm in general for this sort of thing (perhaps a new Compat toplevel 'namespace'). But have the license issues been worked out with mysqli yet? Last I check it was on the verge of being de-bundled.
I know nothing of that, actually :)
Also (since this mail is clearly stream-of-consciousness), how about juts adding the compat functions into the mysqli extension itself and adding a --mysqli-enable-compat flag or some such.
Sure, it could be done at the C level but one of the big "improvements" of the mysqli extension was that it more closely reflected the true MySQL API (that's what was explained to me).
If by 'true' you mean 4.1, then yes, but it doesn't resemble the 3.x api. There was a major API shift from 3->4.
Since one of the clear goals of mysqli was to eliminate these "magical" non-api PHP functions,
Well, it was to bring it inline with the current api, which is very different than the old api. But either way what you are talking about is providing a compatibility layer that reflects the old API, whether it be in C, PHP, or magic pixie dust.
it seems more reasonable to just have the solution be in user-space instead of starting down the road of aliases and non-api calls again (although mysqli does still have a few non-api PHP functions still -- look in mysqli_nonapi.c).
And can just as easily have a mysqli_compat.c
Assuming mysqli is going to become the standard for database access in PHP5/the future, my motivation for this proposal is simply to provide a bridge for the mysql->mysqli transition.
mysqli won't be the standard for a while, as it doesn't work with mysql 3.x.
This layer allows someone basically to pull PHP5 out of the box, compile it using the latest and greatest extension and provide a clean *temporary* backward compatibility until they can upgrade their code to use "native" mysqli calls.
Actually it doesn't, and thats the major problem I see with it. You're looking for transparency, but you only get that if you edit all your scripts and include the compat library in every affected script. Even if I wasn't a freak about using too many includes ( a good reason not to stick this into auto_include), this puts a significant burden on the programmer trying to write portable code. By writing a compatibility layer into mysqli, you (assuming you compiled it correctly), get this compatibility transparently without having to change any userspace code. That's my $0.02. George -- George Schlossnagle -- Principal Consultant -- OmniTI Computer Consulting, Inc. -- +1.410.872.4910 x202 -- 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0

« previous php.pear.dev (#17228) next »