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" <p...@bohwaz.net> wrote:

> 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.
>

Reply via email to