Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110689 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5860 invoked from network); 20 Jun 2020 15:35:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jun 2020 15:35:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 788521804E1 for ; Sat, 20 Jun 2020 07:22:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 20 Jun 2020 07:22:18 -0700 (PDT) Received: by mail-io1-f41.google.com with SMTP id c4so1037863iot.4 for ; Sat, 20 Jun 2020 07:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=naYJNM3H/LcribZWxe/3bS3j8uMPeGa8psElTSAuBHE=; b=TpwUVSf7Akv9a0DTD1wEupzTr6Z2veEaxmljOTgZlD+HmS+j6qjW5ktN5Vv5KlZFKH C6Nw6Izlf3tf8J9FRXclC2HdAZwg1mest7AT1mxNG+59qMq61H68H7TRoLbWK0eVxNq+ dtsmhLHjTGIQafn+WTu7gY1s83va0/QHECvpieR2hsn+PJLmOXTb1wUCGSLm6uAUcUB8 vZThIaNwXCPPoRwkI/KS7B2FgMfxKzEvfejkG87n5k2/Ahf2kAn5YG9h6Ejro/51J/9W nPp4cppe80bPVL1VAl77Kzq0OAFMKQTufOQdp9+cBORJiOMc0NYr4Qj/wwXGNgKxJP1I HKMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=naYJNM3H/LcribZWxe/3bS3j8uMPeGa8psElTSAuBHE=; b=RYqMpvhAZWd99AFEhx5uHVMFnyuolBjdk+c8y1DzJet4hj5NcdJBdzoC3g6BbAj5Rb wCFjgKLiGRYpvW5jlNQfKlMtuN7WP8dnvyC212d1vEdyjseW+aPMn8M+ozumcPxqxlpm 1Om+j127ofQ0QDKV2lFjbK6/wtenrnnzMKwkmcLyp5JSk0yK/iSLW6HMmVvAibXnFX5G Di1TOSVK6VBSjZUf3+gdDu782H/U5TVrqJ6AZ+Ohpk1AL1DxllAlDrxQvKw1wT2pol7v 14Iic5L3dKCdNgI/2acy1QGVboZjTqcrxINTG429Fkc1UToM4O1/RJSVpcohzOxDIdEj yvFA== X-Gm-Message-State: AOAM5328IO/fnrzTazAdDHuIlEWjNmKCYK+Q2Cj4fOnYgF25W+GVnKN1 rqyh1Zm6fWJWB0heWXymmokD7A4b X-Google-Smtp-Source: ABdhPJxoeQfPXlIuPZEMmwYAdlKqFjUkbTP+G4T8HXETfusw4ikOm1PNhvZzei2UoylTZAVruEzAcA== X-Received: by 2002:a05:6602:2d4a:: with SMTP id d10mr9914148iow.26.1592662932802; Sat, 20 Jun 2020 07:22:12 -0700 (PDT) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com. [209.85.166.46]) by smtp.gmail.com with ESMTPSA id v13sm433279iox.12.2020.06.20.07.22.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Jun 2020 07:22:12 -0700 (PDT) Received: by mail-io1-f46.google.com with SMTP id i4so11531358iov.11 for ; Sat, 20 Jun 2020 07:22:11 -0700 (PDT) X-Received: by 2002:a6b:3bc6:: with SMTP id i189mr6802417ioa.180.1592662931422; Sat, 20 Jun 2020 07:22:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 20 Jun 2020 15:21:35 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Dan Ackroyd Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000465e2605a884bc3d" Subject: Re: [PHP-DEV] SQLite3, PDO/SQLite and driver specific methods From: phpmailinglists@gmail.com (Peter Bowyer) --000000000000465e2605a884bc3d Content-Type: text/plain; charset="UTF-8" On Tue, 16 Jun 2020 at 11:41, Dan Ackroyd 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 --000000000000465e2605a884bc3d--