Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49746 invoked by uid 1010); 10 Sep 2007 19:10:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49731 invoked from network); 10 Sep 2007 19:10:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2007 19:10:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=buildsmart@daleenterprise.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=buildsmart@daleenterprise.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daleenterprise.com from 67.78.11.229 cause and error) X-PHP-List-Original-Sender: buildsmart@daleenterprise.com X-Host-Fingerprint: 67.78.11.229 daleenterprise.com Received: from [67.78.11.229] ([67.78.11.229:53471] helo=daleenterprise.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/13-27808-0A695E64 for ; Mon, 10 Sep 2007 15:10:25 -0400 Received: from localhost (localhost [127.0.0.1]) by daleenterprise.com (Postfix) with ESMTP id 7605B243FDF; Mon, 10 Sep 2007 15:10:22 -0400 (EDT) Received: from daleenterprise.com ([127.0.0.1]) by localhost (daleenterprise.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07151-14; Mon, 10 Sep 2007 15:10:20 -0400 (EDT) Received: from [10.1.100.11] (relay.mustangrestomods.com [67.78.11.226]) by daleenterprise.com (Postfix) with ESMTP id BAA8E243FD5; Mon, 10 Sep 2007 15:10:10 -0400 (EDT) In-Reply-To: <46E5882B.7010909@mysql.com> References: <199717507.20070910145329@marcus-boerger.de> <64047417-3838-4E20-B767-110266B9F4A0@daleenterprise.com> <46E5882B.7010909@mysql.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: Cc: Marcus Boerger , PHP Developers Mailing List Content-Transfer-Encoding: 7bit Date: Mon, 10 Sep 2007 15:10:09 -0400 To: Hartmut Holzgraefe X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.2) MTA-Interface: amavisd-new-2.3.3 (2005-08-22) + Maia Mailguard 1.1.0 at daleenterprise.com X-Spam-Scanned: using SpamAssassin 3.1.7 (2006-10-05) at daleenterprise.com X-Virus-Scanned: using ClamAV 0.88.6 (2006-11-05) at daleenterprise.com Subject: Re: [PHP-DEV] PHP_FALIAS() From: buildsmart@daleenterprise.com (BuildSmart) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 10, 2007, at 14:08:43, Hartmut Holzgraefe wrote: > BuildSmart wrote: >> Thanks for the response, OK I think I can manage that with ease, >> what I'm contemplating to do is create a mysql_alias extension >> that aliases the mysql extension functions to the mysqli equivalents > > uh .... PHP_FALIAS() would only work for functions having > exactly the same parameter signature ... so it would only > work with a very minor subset of the mysql/mysqli functions > (if at all). For a lot of functions the signature changed > so that the database handle is now the first parmeter > instead of the last, and even for those that look similar > you have to take into account that mysqli relies on objects > (even for the procedural style functions) where ext/mysql > is all about resources, not objects. > > There is also the concept of the default connection > in ext/mysql that does not exist in ext/mysqli at all > so that can't be emulated by just aliasing functions > either ... Yes, I realize that not everything will be directly mappable without some kind of helper functions and this includes creating some default fallback settings. > > While a ext/mysql -> ext/mysqli compatibility wrapper > might make sense it is way more effort to create one, > and if you really want to go that way i'd recommend > that you do a proof-of-concept implementation using > PHP code first before starting the effort to wrap > it up in a C extension. Always a good approach and well worth adhering to as it would allow for validation of the concept before implementation. Perhaps the best approach would be to mimic the ext/mysql functions and feed them to ext/mysqli function rather than aliasing them directly but maybe a performance trade-off might be encountered as a result. On some cursory tests I've found that the ext/mysqli extension functions seem to execute faster, while not a significant leap in time based on a single DB query .472ms as compared to .279ms, over a period of time this can amount to a significant savings if the site is query intensive. > > That aside i don't think that it would make much sense > to create such a wrapper, ext/mysql being deprecated > says that we won't add any new features to it. There > are no plans to remove it though and any serious security > issues or possible incompatibilities with newer libmysqlclient > versions will still be fixed. My main goal is to increase performance, I think that working from a proof of concept based on a small subset of minimum required functions might be the first order of business to determine if any loss would be experienced and if so then going further would be a waste of time. As well, what works in a controlled environment doesn't always reflect a production environment so the whole project might be nothing more than an exercise in futility but if I don't examine the possibilities I'll never know. > > -- > Hartmut Holzgraefe, Principal Support Engineer - -- Dale -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) iD8DBQFG5ZaR0hzWbkf0eKgRAn18AKDAxJPq0AzxhNyfaYvStPnTAsoRmwCfbcjX YaMSOcjOvtP6KGAbt3oitFQ= =HsJl -----END PGP SIGNATURE-----