On Tue, 16 Jun 2020 at 11:41, Dan Ackroyd <dan...@basereality.com> wrote:
> Note, I haven't done the work to actually make sure that this plan is > actually feasible, so it's not guaranteed to be the correct approach. > But it still sounds sensible and would scale out to other custom > methods for other connection types, and avoid any magic. > > If you (or anyone) have the time to work on this, that would be fantastic. > Well, I gave it a go this week! I last wrote C 2 decades ago, and those were simple programs. Digging into the PHP source code is a fun challenge. I worked out how to create a new class [1] and to get PDOSQLite to extend PDO [2]. Extending PDO took some thought; Reflection extension does it but all classes are defined in one file. SPL, DOM etc also do it with their classes. Eventually I saw how SimpleXML did it and was able to apply that. I've got stuck with adding `PDO::connect('sqlite:...')` [3]. Can someone take a look and give me advice? Peter 1. https://github.com/pbowyer/php-src/commit/bcbdce9134e695d4926d11f2fa1a855b3237db6e 2. https://github.com/pbowyer/php-src/commit/90a9c20fa1f8a626df8636f6c9e4f974fd789daf 3. https://github.com/pbowyer/php-src/commit/51654eeae9407dc8991d62155719fbfea211f735