Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110579 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99019 invoked from network); 16 Jun 2020 11:56:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jun 2020 11:56:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5763B1804DA for ; Tue, 16 Jun 2020 03:41:46 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (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 ; Tue, 16 Jun 2020 03:41:45 -0700 (PDT) Received: by mail-vs1-f45.google.com with SMTP id k13so11130529vsm.13 for ; Tue, 16 Jun 2020 03:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=79k2KFwgD7m4dSAkLBf3e8Zm2mT8HGul5LbsmZdxAa0=; b=rpps+FdqmrH3qWHYWy2WL2mEJvBwcxlYCe2n6Ord3AayiA1KxoIbJqS8x1sJAZMWdx ulT9t5Lw8b3b/jage66w4hKnS9BiyHYftMpBMZED9VwxGUJLlA8bSSy+M9N9/6bRqUBX h0Z4bmU2g7zJpTKyQN70MOHGZ7igUfKljzRfLuIaPghTdFQfFn4213QW4l/pKHepTEJB yURY/f5sI86isyDr2OoxIgXyaOFeumJ7tYdj7wYqcxsmK6stSqBLVPAb4Baeb7eafiYF 0st9NyaziWy5jIqTO3IEyvVa6jQMTZqTyMV96Q+Z0zRwa4jJ1HNdoUmNdFOqgl2OuJv2 3nFQ== 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=79k2KFwgD7m4dSAkLBf3e8Zm2mT8HGul5LbsmZdxAa0=; b=Ci2tuGVNzQth47iQ1U7AppB7hbZVdc9wOWZ3BwOgdLqsgPJaYS22rhczDzFpagwLXV dJDS5ofsrZYVMRqmk75iOUQpka2zjpr77w6O8NQeJNmmN8d4UQjksd/PDpSmEkG1kvgC 3x44+eVnZUTMSMGvXNReWvE2rGY7yJGnQclavJB6k+WAO/2NWGpjj8aUWHTv+bVq8II9 VTGpToaGQT3KnxcSdg3UIa5DqjuawR4Tr6jm0jDH6leZLQSgR/3eqKtirPHU1+RgOs0S WpoHKTruHrsLUKYHA2ncnPvUoFGSlR87hAPDeZH781R6P+DZCJPoYdk9f1yZpm7zsy5r GLqw== X-Gm-Message-State: AOAM532ts/93pxu+60w17yIDIM2JFsgi+q4t3xqk46D9NVINqgnlpoZR rUV1Pu9yJ7p/oOV9DBJDY+Ln2Ml45CfQBUXqhE/y9Q== X-Google-Smtp-Source: ABdhPJypZ+5ZARtKNAgbFmmk5MODJd4RhouB9Ifx1+7Jh2RXM2z+1BcJoX1yijF/jngFdUAydk+HTmVbsVlHGyYY02Q= X-Received: by 2002:a67:c381:: with SMTP id s1mr934777vsj.183.1592304102945; Tue, 16 Jun 2020 03:41:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 16 Jun 2020 11:41:30 +0100 Message-ID: To: Peter Bowyer Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] SQLite3, PDO/SQLite and driver specific methods From: Danack@basereality.com (Dan Ackroyd) On Tue, 16 Jun 2020 at 11:32, Peter Bowyer wrote: > > If it is, how can we change and improve the current situation? > Hi Peter, I think what I wrote earlier is still a good approach: https://externals.io/message/100773#100813 > 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(...); > } >. // return new PDO(...); > } > } 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. cheers Dan Ack