Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120354 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60330 invoked from network); 19 May 2023 02:01:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 May 2023 02:01:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 53D7C180503 for ; Thu, 18 May 2023 19:01:11 -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, T_SCC_BODY_TEXT_LINE 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-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 18 May 2023 19:01:10 -0700 (PDT) Received: by mail-vk1-f177.google.com with SMTP id 71dfb90a1353d-456ff5c55e3so46734e0c.0 for ; Thu, 18 May 2023 19:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684461670; x=1687053670; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8dreNH9whkhiQ2rjFMMuUZE0TxnEJrS8ZXpZ+PyjEx0=; b=PLTRHGx0cZeZRNjkP1O5Ns2vrxg5HBRt5ZEKF5OA8q6+TMvUVFMRKIfMeSrNutDG26 ZiAdnNZu4BLDLyPoTPQoNGaaExPFjOSwEPDigqUubbNXH0r/ExzQYKmr/Szl8jS6v1mP AAiAqEozHzqpH44uAOjB7P26MAZQbGISiqsD0KbgxDxEzFSXkVvSOd6KBD04AmfFE8K7 182RUS93KmuVAJ2Y2aAq3hwIsLgWF2RY3BOmlJzBiuiKs44FQcNNUKqnphFsWTcP6YY7 9xj6SxU6vHmtCQHq9p2SeLbINk20IV6oio1wqgrxh5KIdjRHxaRyklK46AFMOi3x6gV+ ci8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684461670; x=1687053670; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8dreNH9whkhiQ2rjFMMuUZE0TxnEJrS8ZXpZ+PyjEx0=; b=VoYFvJYCWn3/Rj8vIbYdApBiZO29uh32KmeBHHczOzONZtbiGTEdmFqpDnyh8A7/h1 N2TfSvt2pyFOCuH3jXg62XNxjuprkDKTPr6bRi/jFlEVsld9lGDodgBFVinH4b0+8g0E 5XNJ01F/Cezwcl7YtPcr/Ht4AK5K94gcXPBFtq3q6OiCu8dF+QAAVnyv/EV3UByhe/iu OtxJDARQ3u+g2hz7D3WUaEYF6L1RgyYhAAN5N6Lzy7YaGKMJv2NyFZ8ZAins1A8Xgumq GrPiTrQ8CgdI3IJKmLwOu4FvPhljNxCZex7NHvkstOQcVjp0PeBgcTToNPYnqEJFlFyR DGdQ== X-Gm-Message-State: AC+VfDwA3Z338Ve6VLkyPKG3fM4JMJovQbN9uhZLg9/ycgq25QSauXhG XMkxX8Z6nGUCNtm+aMDwbynpWzhZz1kpji/nlc4= X-Google-Smtp-Source: ACHHUZ7Q0AcLQkk7paVZdmMsHs6Cgz5rprXrALUaRGjJhfGli5jFpsAQFtYIRyTX1Plsygpe6ju7n98zTvziod8k5hg= X-Received: by 2002:a05:6102:14a0:b0:437:e2f6:cf5b with SMTP id d32-20020a05610214a000b00437e2f6cf5bmr177219vsv.0.1684461669779; Thu, 18 May 2023 19:01:09 -0700 (PDT) MIME-Version: 1.0 References: <000201d9897f$aa9f9fa0$ffdedee0$@roze.lv> <3021A824-1EDC-4523-814A-A0DA8187F068@gmail.com> In-Reply-To: <3021A824-1EDC-4523-814A-A0DA8187F068@gmail.com> Date: Thu, 18 May 2023 23:00:33 -0300 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000770b5d05fc024bb4" Subject: Re: [PHP-DEV] PHP Package for PHP From: deleugyn@gmail.com (Deleu) --000000000000770b5d05fc024bb4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 18, 2023 at 6:56=E2=80=AFPM Rowan Tommins wrote: > On 18 May 2023 20:15:44 BST, Deleu wrote: > > I meant exactly the opposite. Monolog is an example of what PHP (is > missing > > =3D=3D=3D doesn't have enough of). There's hardly any reason to re-rele= ase it > > under the PHP umbrella. Monolog already won the log battle. I can't say > the > > same for virtually anything else, to be honest. Some folks might say th= at > > Guzzle won the HTTP battle, I just disagree and think we could have > > something better by default > > > Let's look at HTTP clients then. > > PHP is certainly lacking a good one built in. Using streams with > allow_url_fopen is serviceable for fetching a page, but not much else; th= e > curl functions are ... embarrassing. [..] On the other hand, a clean API with a much smaller feature set, which could > be used on its own for simple use cases, and be the low level > implementation for Guzzle, Symfony HttpClient, etc, would be extremely > useful. In other words, an overhaul of the curl functions to give the sam= e > flexibility, but an API that feels more native to PHP, rather than a thin > wrapper around the C functions of libcurl. Let me start from here where we agree on. We start by designing a new PHP package to wrap cURL. Bear in mind for a minute that I started this thread with the intention of lowering the barrier of getting RFC approved and the code being maintained by PHP developers. After some good amount of bikeshedding we approve the first PHP package. It is fully covered by automation tests so that future maintenance is relatively easy. It gets released under the namespace Php\8.4\Curl. I'm going to be greedy here and assume we even get it bundled inside PHP. Before PHP 8.4 gets released we also work on Php\8.4\Strings package. For the sake of argument let's pretend that within 1 month of PHP 8.4 release we discover that the Curl package was actually really bad and we decide to rework it. A new RFC is approved and we bundle a new design under Php\8.5\Curl. Meanwhile Strings was a success and no new version is warranted. So Php\8.5\Strings does not need to exist. Now both new designs are still great and Php\8.6\Curl and Php\8.6\Strings do not need to exist either. Perhaps someone raises an RFC so that PHP 8.7 will unbundle/eject Php\8.4\Curl and keep only Php\8.5\Curl inside PHP. It's a breaking change, but one that just means we now move the code to being Composer-only instead of bundled inside PHP. It's a "deprecated" package that can just exist on GitHub for backwards compatibility. A few more years go by and another RFC comes in to abandon Php\8.4\Curl from the PHP Group. This whole story, from a user standpoint, screams stability. If a project starts using Php\8.4\Curl and gets so deep into it that it's too expensive for them to upgrade, they can just keep using it without upgrading to the 8.5 counterpart while still upgrading their PHP binary. If it gets unbundled, they can just `composer require` it. If years go by and the package gets abandoned, they can still fork it and pretty much no code change would be necessary. With namespaces, PHP Packages get to do "Editions" without all of the complexity of doing editions at the engine level. Written in PHP, it can easily get ejected out of the PHP binary and still be "backward-compatible". PHP seems to be at a corner where it's best not to do anything than to make another mistake. A mistake made in the design of the language takes decades to undo. I believe we can improve the language's basic functionality this way and slowly grow into wrapping most features needed by the majority of web applications. We could start with just wrapping libcurl in a nicer API and if it works out great we could do more until one day we end up even providing a slim HTTP Client. The PHP community as a whole (regardless of which framework camp you are in) as well as newcomers could only benefit from it. --=20 Marco Deleu --000000000000770b5d05fc024bb4--