Re: Re: [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

From: Date: Tue, 03 Oct 2017 13:59:01 +0000
Subject: Re: Re: [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-100813@lists.php.net to get a copy of this message
On 2 October 2017 at 22:48, BohwaZ/PHP <php@bohwaz.net> wrote: > > If you follow your logic, then PDO::sqliteCreateFunction shouldn't exist, > and this would make the PDO sqlite driver pretty much useless as SQLite is > missing a number of important functions. That's taking it to the illogical conclusion. Taking it to a better solution is that the method sqliteCreateFunction shouldn't exist on the PDO class, but instead on a PDOSqlite that extends PDO. class PDOSqlite extends PDO { public function createFunction(...) {...} } class PDO { public static function connect(string $dsn [, string $username [, string $password [, array $options ]]]) { // if connecting to SQLite DB { return new PDOSqlite(...); } } } This might be a mistake in how it was implemented originally. Looking back it seems that it was implemented before we had the RFC process....and is exactly the type of 'sub-optimal' implementation the RFC process is meant to prevent. > This is why I am pushing for PDO to be feature-full, so that you have the > choice to use PDO and not have to implement your own abstraction layer just > because you need one specific feature in one single case :) > That's a great aim! But rather thank just hack in new features building on sub-optimal ways of doing things, I think it would be better to create a plan to clean up the way that connection specific methods are available, with something along the lines of that which I mentioned above. cheers Dan Ack

« previous php.internals (#100813) next »