Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73138 invoked from network); 23 Aug 2017 05:20:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2017 05:20:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wm0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:37009] helo=mail-wm0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/7B-34801-9801D995 for ; Wed, 23 Aug 2017 01:20:09 -0400 Received: by mail-wm0-f42.google.com with SMTP id b189so7501329wmd.0 for ; Tue, 22 Aug 2017 22:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pZYgT33WcIQ9+JdBmSf2lZcpXKNNZCrMGHixpTb/kqY=; b=OtIVgh6IKMWJ+CEIvjHCTqSLunY2HUX7Rbo+yOgCXoJZhcJoAlrKSJitu891gukFhJ tkNdBqoU9Cm3+hq/QNg7iDXSPYrRu+QftCDl1Q/4eZG+gedxZexJdALWkVCseBv0Mm23 9Okb/15bSGb64HHh7syFfm6eH1+CfR84dvY9aCwRpljtCKZHoqfvoFavJbmsyszvqx4t jKXFqZ8LxOaI1Yh6VPc0Uxfoz6WJJAENHS8yQ+CyqHnh36GQmHQlIzeQxMq9/2X/XR32 JjcHhtaQ+u2jifOQ1kPVatRlijmw9cBbFeBDtCZXMN3VTUGrenrtnvzdQFvF0kRKhpTc pv5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pZYgT33WcIQ9+JdBmSf2lZcpXKNNZCrMGHixpTb/kqY=; b=ByuBAO2eV2DrDVR3fpALt2S8yEwX4Zhxes9GYB9tuV9jlHegudHybHz7Mdm1jHOAO6 M3UDUVr9DNW73E8wmR0Hl/oFClcgQHxHLpCvemtK4DJJ7qwABlivFl7054GvVJcF6mNN paViwK1hPvCobjNygOVBURQdz5IlhABBb7OCInza+Gz2/c/FVx5HEw8u+hSv7l2WW7+c YVgfOPdGj1ih/yyK0jal6y9QOQ60npWtQQAZiWmK287Wt84eb3R6x5W0fw/SaydaDvXX fDkvrKTEyb0sKqShk4Fuk5OhqBhp7/Q8hHLzMKSgCozp71QMmseNI+ySBsFEE9DIht9+ g0/A== X-Gm-Message-State: AHYfb5iVVILGXewFq4QcKLo6DiRUe5idogff6MGWYkwpvD4ncAzFwjna J9dv8ozl9b41M87ZcmsbEFymIDn2bbZh X-Received: by 10.28.208.132 with SMTP id h126mr813191wmg.95.1503465606012; Tue, 22 Aug 2017 22:20:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.135.154 with HTTP; Tue, 22 Aug 2017 22:20:04 -0700 (PDT) Received: by 10.223.135.154 with HTTP; Tue, 22 Aug 2017 22:20:04 -0700 (PDT) In-Reply-To: <61a5739f15f3a645fd9406fa44fa3f59@bohwaz.net> References: <1e398f12adbdbed6b7caf3b0af07f284@bohwaz.net> <069c08bfe15b856007debab5d0d961be@bohwaz.net> <7b50581b7b2b96920867de76f75c0dfd@bohwaz.net> <61a5739f15f3a645fd9406fa44fa3f59@bohwaz.net> Date: Wed, 23 Aug 2017 07:20:04 +0200 Message-ID: To: "BohwaZ/PHP" Cc: PHP Internals List Content-Type: multipart/alternative; boundary="94eb2c19339e60e4af055764ddb3" Subject: Re: [PHP-DEV] Matching PDO_SQLite features with SQLite3 extension From: ocramius@gmail.com (Marco Pivetta) --94eb2c19339e60e4af055764ddb3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable PDO\sqlite_open_blob($pdo, ...). And no, just because a lot of folks jumped from the bridge doesn't make jumping from the bridge acceptable. You can pursue the approach, but you will get a negative vote from over here: that's also where my influence stops though. On 23 Aug 2017 7:15 AM, "BohwaZ/PHP" wrote: > Le 23/08/2017 16:57, Marco Pivetta a =C3=A9crit : > >> 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 =3D new PDO('sqlite::memory:'); > $extended =3D new PDO_Extended_SQLite($pdo); > $blob =3D $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 PD= O > 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 rewri= te > 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 tim= e > 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. > --94eb2c19339e60e4af055764ddb3--