Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100286 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71617 invoked from network); 23 Aug 2017 05:15:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2017 05:15:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@bohwaz.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@bohwaz.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bohwaz.net designates 5.135.163.151 as permitted sender) X-PHP-List-Original-Sender: php@bohwaz.net X-Host-Fingerprint: 5.135.163.151 sanguine.kd2.org Received: from [5.135.163.151] ([5.135.163.151:54260] helo=mail.kd2.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/2B-34801-28F0D995 for ; Wed, 23 Aug 2017 01:15:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bohwaz.net; s=mail; h=Message-ID:References:In-Reply-To:Cc:From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:To; bh=jjI8V9NPIFVRbtL62Mq9sRtgDXpfqgTmX5XtV6QBj7A=; b=aju51juqBKiy966Lc4BaXA+rKjnocRf9kQ8VBZhCJ3SD9oj7Jb0jy7j/3XcZTPUJHtCWLPxKhQjewPLSjGrbyj7JnXwD3H1MrVhebRMkI3pirwXXX2f8zDM1Javm5wVS7KoeHVmn+M5adUWrT7WE+zTuQpk13YzgXNzVvk2QIjY=; Received: from narragoon by mail.kd2.org with local (Exim 4.84_2) (envelope-from ) id 1dkO11-00055h-AS; Wed, 23 Aug 2017 07:15:43 +0200 To: internals@lists.php.net X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 23 Aug 2017 17:15:43 +1200 Cc: Marco Pivetta In-Reply-To: References: <1e398f12adbdbed6b7caf3b0af07f284@bohwaz.net> <069c08bfe15b856007debab5d0d961be@bohwaz.net> <7b50581b7b2b96920867de76f75c0dfd@bohwaz.net> Message-ID: <61a5739f15f3a645fd9406fa44fa3f59@bohwaz.net> X-Sender: php@bohwaz.net User-Agent: Roundcube Webmail/1.1.5 Subject: Re: [PHP-DEV] Matching PDO_SQLite features with SQLite3 extension From: php@bohwaz.net (BohwaZ/PHP) Le 23/08/2017 16:57, Marco Pivetta a écrit : > I suggest adding dedicated functions that given a PDO instance and the > parameters you needed do what you want to do. So if I understand correctly: $pdo = new PDO('sqlite::memory:'); $extended = new PDO_Extended_SQLite($pdo); $blob = $extended->openBlob(...); That's kinda better, but that doesn't solve much, as that means that only one method will be in this new class, and PDO will still have sqliteCreate... methods as we won't cause unnecessary BC breaks. I'm not a C developer though and I don't see how that would be possible. My feeling is that it would have been better to have a class extending PDO for each driver, adding additional constants and methods, but that's not how PDO has been designed, and I'm not gonna suggest that we should rewrite PDO now. > And yes, you are adding new stuff: php-src has this widespread > misunderstanding that "reproducing new lower layer behaviour in upper > layers" should happen no matter what. I don't get your point, this is already in a upper layer no? PDO already has that for SQLite and I just checked and pgSQL too: PDO::pgsqlCopyFromArray PDO::pgsqlCopyFromFile PDO::pgsqlCopyToArray PDO::pgsqlCopyToFile PDO::pgsqlGetNotify PDO::pgsqlGetPid PDO::pgsqlLOBCreate PDO::pgsqlLOBOpen PDO::pgsqlLOBUnlink I'm not gonna create another way of having driver-specific features that wouldn't make sense in relation to existing methods, and I don't have time to rewrite a significant part of PDO that would cause a major BC-break. We all agree that this is not the best way, but it's too late for that I think. So can we go back to topic? I'm just trying to improve existing PHP in the (very little amount of) free time that I've got, following what has already been done, not trying to refactor/reinvent/do major changes stuff here.