Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32985 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56974 invoked by uid 1010); 26 Oct 2007 18:52:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56959 invoked from network); 26 Oct 2007 18:52:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2007 18:52:41 -0000 Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 85.10.196.195 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 85.10.196.195 serveforce1.backendmedia.com Linux 2.6 Received: from [85.10.196.195] ([85.10.196.195:45091] helo=serveforce1.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/EE-03518-87732274 for ; Fri, 26 Oct 2007 14:52:40 -0400 Received: from [10.142.30.231] (gprs01.swisscom-mobile.ch [193.247.250.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by serveforce1.backendmedia.com (Postfix) with ESMTP id 08FD81224247; Fri, 26 Oct 2007 20:54:05 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <698DE66518E7CA45812BD18E807866CED4BB1B@us-ex1.zend.net> References: <1D.BB.03518.30622274@pb1.pair.com> <698DE66518E7CA45812BD18E807866CED4BB1B@us-ex1.zend.net> Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Message-ID: Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Oct 2007 20:52:22 +0200 To: Andi Gutmans , PHP Developers Mailing List X-Mailer: Apple Mail (2.752.3) X-backendmedia-com-MailScanner-Information: Please contact the ISP for more information X-backendmedia-com-MailScanner: Found to be clean X-backendmedia-com-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0, required 6) X-backendmedia-com-MailScanner-From: mls@pooteeweet.org X-Spam-Status: No Subject: Re: [PHP-DEV] [PATCH] Generate warning when using PDO::setAttribute() and ATTR_PERSISTENT From: mls@pooteeweet.org (Lukas Kahwe Smith) On 26.10.2007, at 20:44, Andi Gutmans wrote: > Why is it not an if() statement? > >> -----Original Message----- >> From: Ben Ramsey [mailto:ramsey@php.net] >> Sent: Friday, October 26, 2007 10:38 AM >> To: internals@lists.php.net >> Subject: [PHP-DEV] [PATCH] Generate warning when using >> PDO::setAttribute() and ATTR_PERSISTENT >> >> For a while, we were scratching our heads over why persistent >> connections were not being created when using PDO_OCI, even though we >> were explicitly calling PDO::setAttribute() to set >> PDO::ATTR_PERSISTENT. >> >> My colleague Brian DeShong further explains the issue on his blog: >> http://www.deshong.net/?p=3D61 >> >> "You must set PDO::ATTR_PERSISTENT =3D> true in the array of options =20= >> you >> pass to the PDO constructor! If you call $pdo- >>> setAttribute(PDO::ATTR_PERSISTENT, true) after the instantiation of >> the object, you won=92t be using persistent connections." >> >> He goes on to say: "It=92d be nice if PDO::setAttribute() raised a >> warning if you try to set PDO::ATTR_PERSISTENT, by the way." >> >> I'm submitting the attached patch to do just that. :-) Personally I find the entire attribute stuff in PDO a gigantic mess =20 which I said before the first release. Some things are not attributes =20= you can set, some of the things you cannot set at runtime etc. So =20 something are "attributes" of the connections, others are options and =20= yet others can only be set at connect time, so they should not even =20 be accepted as valid parameters to whatever set*() method as you =20 point out as it will have no effect. This should really be cleaned up =20= one day (PDO2?) regards, Lukas=