Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120342 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2596 invoked from network); 18 May 2023 15:27:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 May 2023 15:27:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3789E180209 for ; Thu, 18 May 2023 08:27:50 -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-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (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 08:27:49 -0700 (PDT) Received: by mail-ua1-f54.google.com with SMTP id a1e0cc1a2514c-77d2be6a0f7so81599241.0 for ; Thu, 18 May 2023 08:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684423669; x=1687015669; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7PcZe1fvYEn9/BY+iv/MqpnSKbP0/WbRcjjLMS0xbfM=; b=hjd2wfV29zwRA8PeKY9lIlpUezdFCfEIUTnimKWbaR4qvDkMyJvW78i+o/579PtZRO UxmWzby4I/dL/xg3cDWO6gUUc0cTvfYtzEIDH1TFkqxEA2ILnhxX0BuHd8sWe89X3SOP BFbdcCwl2RPNZRryGeELGUjx3aZ0a9AuxlfGNrnPeP2jf0MtEAo9ghmX2aGaDtViRZx+ aOrGoqlm64k2cLPAuHKwBjyB0/Gg6DYqH6mhpaR5dtsUe3cnv/eP6p/IwDssAshjwMJE uhCzCdmi99NFnOoVIRuIWU7944OWKgpJOw11HzWoBqJM/3wcU0oIyRrTRg05yiI6WDLK nNeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684423669; x=1687015669; 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=7PcZe1fvYEn9/BY+iv/MqpnSKbP0/WbRcjjLMS0xbfM=; b=hVr0oUShUu5o0AtiQLX2D5KQ2mUSDteAZlTyKui0cVUPnf/ktYBfUmeMb3G6xV1NHt xTSDWt9YxkYVbjZjQ5xjADGueKSU1drvhLBLHWLYJvIn5X/o0iZvH6TvuE1REWlFyg1f 7/HYucQHZ2A+ZYGvSdy/lItngSx/Ht60yyUxd1ze4DfDU5mpI6jQPZVbq9oL38/98Ju/ MGAqZvOu2DW3//AxDMF2CC7BSLe4R81wUfJyT8c11cRK5WENuYPB/8kNeahQKs+ikvm8 lLXiKbp5jAES5DaH4VsW/wT4VvabYqo/S6eD+TonLJzSpofEz0+p/2ZUrlhLTlJ2UN43 yOhQ== X-Gm-Message-State: AC+VfDwvzIwClS0eOP2ILTmaKvLcGY2005Yi7pBK1b9n5p1Blh3bo3C8 Fc1WInh8ogDHZMKn4uZhthwVBbQwSpgEg5lJECmOgEOZ61I= X-Google-Smtp-Source: ACHHUZ4Wt3Eetz0RTJzZlutQyOlBTD72ZZx1XN1QKgZVyhpTyrqHPVWrPoXeYjoPRcqOVwuS99nPVpmHq0I2Af81kos= X-Received: by 2002:a05:6122:c9a:b0:431:f9cd:5a27 with SMTP id ba26-20020a0561220c9a00b00431f9cd5a27mr2810948vkb.1.1684423668665; Thu, 18 May 2023 08:27:48 -0700 (PDT) MIME-Version: 1.0 References: <000201d9897f$aa9f9fa0$ffdedee0$@roze.lv> In-Reply-To: Date: Thu, 18 May 2023 12:27:12 -0300 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006c131b05fbf97238" Subject: Re: [PHP-DEV] PHP Package for PHP From: deleugyn@gmail.com (Deleu) --0000000000006c131b05fbf97238 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 18, 2023 at 11:27=E2=80=AFAM Rowan Tommins wrote: > On Thu, 18 May 2023 at 14:12, Deleu wrote: > > > > Or PEAR? > > > Like that particular path_join() request is exactly > > > > > > https://pear.php.net/package/File_Util/docs/latest/File/File_Util/File_Ut= il.html#methodbuildPath > > > > > > I have worked with PHP for 14 years now and I know nothing about PEAR. = It > > either says something about me or about PEAR. > > > > > For many years PEAR was the official package repository for PHP. The clie= nt > was shipped with every install of PHP, and still serves as the basis for > PECL, the official distribution for PHP extensions. > > From the point of most users, it has been entirely replaced by Composer, > and I think some of the reasons for that are very relevant to this > discussion: > > - PEAR required a package to be installed globally on a server; Composer > allows (and encourages) it to be local to a particular project > - PEAR was a "walled garden" - you had to request permission to publish a > new package, or take over an existing one; Composer is a "bazaar" - anyon= e > can publish a package to Packagist, and projects can be forked > - PEAR tried to be a cohesive ecosystem - it had a unified coding standar= d, > and a strong policy of package interoperability, aiming for a common "fee= l" > across all packages; Composer leaves developers to combine packages howev= er > they want > > On the one hand, PEAR was a single "baseline" that everyone expected; on > the other hand, packages tended to be slow to adapt to new needs and > fashions, and inflexible to different environments. So instead, people > moved to: > > - Frameworks; which themselves have mostly adopted a "component-based" > approach interoperating via Composer packages > - Non-framework groups like The League of Extraordinary Packages > https://thephpleague.com/ > - Single packages that have become de facto standards - large projects li= ke > Guzzle and Monolog; and smaller utilities that do one task well, like > Ramsey/UUID > Thanks for the history lesson, this is super useful information, indeed. Monolog is a great example of what PHP is missing - a single library for a purpose. I have never worked with any other library besides Monolog and I never worked on any project which didn't have it installed. Perhaps my bubble might be a limiting factor here, but I get a feeling that Monolog is considered to be The Logging PHP Library. Guzzle is a near 2nd, but not quite there, especially after Symfony built their own HTTP Client and further drove the community split. Laravel has an amazing `Arr` class that wraps most of PHP's array_* standard library and I love it and find it amazing, but it's a niche community within PHP. Newcomers might get exposed to community debates[1] that end up driving them away from taking advantage of a better array_* suite. Laravel's `Arr` class also didn't get scrutinized by PHP RFC so there's no way to know whether it's all good, some good or all bad. > > There are two ways I can see a "standard PHP package" working: > > - As a server-wide install, part of the distributed PHP. That inherits al= l > the downsides of PEAR, but might be appropriate for a fairly small subset > of really low-level functions. > - As a set of Composer packages, managed completely outside the PHP > lifecycle, in which case it's not clear how it would be different from al= l > the packages that are already out there. > > Bottom line, I think there is some merit in having part of the standard > library be written in PHP rather than C, but we'd still want to be very > conservative in what went in there, because most of the downsides of > locking it to the PHP release cycle would still be there, and Composer > seems to be serving the community pretty well for a lot of functionality. > > Regards, > -- > Rowan Tommins > [IMSoP] I also see both options for this to work, but honestly I have no strong feelings either way. For me it's pretty clear that a set of Composer packages offering standard libraries under the PHP namespace and limited to what gets approved by RFCs would be a lot different from all the packages that are all there because it takes away all the time and energy collectively spent in evaluating options and their reputations. We can get started with what PHP offers by default and delay the evaluation process until the PHP standard library no longer supports the use case. It's the standard option and is covered by PHP's reputation. If your use case is not standard, you might reach for a community-provided library that enhances the standard library needs or build your own instead of always having to use a community-provided library or build your own. I also like the option of bundling it together with PHP, but that would take some effort on PHP's Core Developers and I'd rather take the benefits of having a PHP Standard Composer Package than to risk not having it because it increases Core Developers' maintenance burden. The nice thing about it is that if the idea works out great, a new RFC can be written to bring the package into core and have that decision voted individually on its own merits. Finally, one awesome aspect I also see is that when time comes to deprecate, abandon or "fix" design flaws in the PHP Standard Library, regardless of whether it's bundled or a composer package, it can always be ejected into a composer package. If 20 years from now there's a major "legacy" project with a heavy dependency on something that PHP decides to deprecate, they can just fork the package and embed it with their application. One can argue that maybe we can do that today as long as we write a custom PHP extension, but then comes the burden of PHP developers having to know how to develop C and use PHP's extension system to try and bring back functionality that was dropped from the language. --=20 Marco Deleu --0000000000006c131b05fbf97238--