Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120356 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72368 invoked from network); 19 May 2023 04:50:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 May 2023 04:50:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8DD2C1804AA for ; Thu, 18 May 2023 21:50:32 -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,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS36483 23.83.208.0/21 X-Spam-Virus: No X-Envelope-From: Received: from dog.elm.relay.mailchannels.net (dog.elm.relay.mailchannels.net [23.83.212.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 18 May 2023 21:50:31 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|gunnard@gunnard.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 2DED3101797 for ; Fri, 19 May 2023 04:50:30 +0000 (UTC) Received: from pdx1-sub0-mail-a314.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B826110127E for ; Fri, 19 May 2023 04:50:29 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1684471829; a=rsa-sha256; cv=none; b=kHd7IvNgNsUDIwqdboE3EOxzMdiGzGPtQvyAuIGclOUrQkuPmUPo523riuNrh0Rw9G7F+K LQIk2OnFIc98uDpp6nva4BziQdfObv4vp4MoeCz6pLT0HJb8dcUmu9nkGPlLlSBCpQUZyq R2eA/5g7sTUfldR+qb7QD6NlUOHXMdx2P2RAVbYtqayxd2m010XEunb3Cn2xGQYoPw4l8K 2ke0wJdfVt1NC35gKXDFDkEDP5kEyAo/InFhnP1ez9fhnfU7F3aYLE92ym0GGKMAUNs5e9 PDCihKx9xjJUytwIBi4tdLLMovqeKmY6pjChVB8E8C8uiJ+0sBhDMXWZdFdkqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1684471829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ByhUJTyYuZTCbRX0Zi4HP2WASXm1WsDMBS7NJe1RUcg=; b=iPmWv3W6/B0anW8+fZDuVbqtFp/YLvdlFgrm5PzxZNDaSg/+Wj/lX4TEsx+iX6RLVF3asT Zo4ZG8Hk+MgIfE9LFvTbJmvGF93mRgEjbsDBWSBujPtnectO52ujVp69EhLNRHzgXOIF0j bGn5L+WM4FpUOIFuN2taNl3MmJB7ySfgiPpCZUMVaTXPDuq5IKWkQR6V/NOlARlzK+8hkO 3IWc0EkdIa2btPmlByTC002wbrvFLR3B7NIjAG3VqsA6sCE6eeuliOr+Ix850vyBLFWZP8 F7JtJmkLdN5SR8wfqnGfLzj/GG7kv+Ub4Y5aHVIA0wK7uIGgj9fqcnIlSSaemw== ARC-Authentication-Results: i=1; rspamd-5cdf8fd7d9-qfmcz; auth=pass smtp.auth=dreamhost smtp.mailfrom=gunnard@gunnard.org X-Sender-Id: dreamhost|x-authsender|gunnard@gunnard.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|gunnard@gunnard.org X-MailChannels-Auth-Id: dreamhost X-Grain-Abortive: 0fea501426b6b81e_1684471829981_200935245 X-MC-Loop-Signature: 1684471829981:791249122 X-MC-Ingress-Time: 1684471829981 Received: from pdx1-sub0-mail-a314.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.24.74 (trex/6.8.1); Fri, 19 May 2023 04:50:29 +0000 Received: from [172.20.5.188] (unknown [50.219.178.70]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: gunnard@gunnard.org) by pdx1-sub0-mail-a314.dreamhost.com (Postfix) with ESMTPSA id 4QMvY132LdzTZ for ; Thu, 18 May 2023 21:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gunnard.org; s=dreamhost; t=1684471829; bh=ByhUJTyYuZTCbRX0Zi4HP2WASXm1WsDMBS7NJe1RUcg=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=xrfGsxzlFbwsMsrHi8ai7uPBOjRqFZo8q16FAqMDLa8dkAqvXfGsr0cvWTj5kTdmC /dL3qFprt+mxvBIKPfG2oRg44kdMHTGWX6hn9lgJk2EM1Aquyw9v4RGAdbB0jlAkPe uFpuuOuHW+yXqcZnn8FPKH0eb99cKn3/2JvZlvD/mgj09gf1mAQpXnULw6ud9Y2IC7 g9Ij7MOcmPOC8j3Wz0NEdw/rOTHfcGf89Ba/EgvVE9dDeFx7LqeQgEUDz6NeY6CMKa lbTGlcpcYHQ7D4Tf9mWYIav5/hGuzrW/V8UE+0MW/MJgMs+EoTpAoXUlsXEbmwonJT DoPtq+/vN6XhA== Message-ID: Date: Thu, 18 May 2023 23:50:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US To: internals@lists.php.net References: <000201d9897f$aa9f9fa0$ffdedee0$@roze.lv> <3021A824-1EDC-4523-814A-A0DA8187F068@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] PHP Package for PHP From: gunnard@gunnard.org (Gunnard engebreth) On 5/18/23 9:00 PM, Deleu wrote: > On Thu, May 18, 2023 at 6:56 PM 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 >>> === doesn't have enough of). There's hardly any reason to re-release 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 that >>> 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; the >> 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 same >> 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. > > >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 think this is a bold statement about the state of PHP and should have the backing to hold it up. >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. php and curl are two seperate "things" entaties if you will, libcurl works very well on its own. I hear you in your want to have a united community of frameworks but as of now, php is (and correct me if I am wrong in projecting this) is a community that helps to provide ways to use PHP in usefull environments. " PHP seems to be at a corner where it's best not to do anything than to make another mistake. " I think you are more on the money than you are not... but this does not mean that PHP is in anyone's pocket