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

From: Date: Tue, 03 Oct 2017 22:41:17 +0000
Subject: Re: Re: [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-100819@lists.php.net to get a copy of this message
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.
Yes I do agree that the method overloading of PDO by drivers is not the best to say the least. If you feel like rewriting a large part of PDO feel free :) but I don't have time for that, and it's not the subject of this RFC :)

« previous php.internals (#100819) next »