Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124347 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id AF99E1A00B7 for ; Wed, 10 Jul 2024 14:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720620581; bh=sL+evH1GYT/DDFY43B3RARlki2IC3CofEw2kAHKbpvY=; h=In-Reply-To:References:Date:From:To:Subject:From; b=fFnH3OreQlZSxdJX/4Vi8OjGbEjqtwH/u0+OedOF2mlYY+cQTlk0h+YgakhcCS9ox rBBkwNEQ5Idj7FwXpsVhQTLDZCm4RA/jNFh/oG3mOTxQmOj2XfZXEva/D0/DDWNnwj vHYx1y2moEgIDygyTIJkJ0L628F8CY6IZMSQSD6UbEXRfRY4uNAzFwV0ujKXYfJ2Da L+Lg3JpUJ3gZNP4R2gaHrt58mfwOYFnP54IPVcjI1IZP9Sc+vvQOaoOO1cpNBuSjmT XzmZtr23xjv93u3ReqLzs7Eei3atJ3nwm0FLnFbOGoYtbr22CEOIhk2R3vFEpkG8hL cf1tWKWABsmnw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ACA3F18007D for ; Wed, 10 Jul 2024 14:09:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout8-smtp.messagingengine.com (fout8-smtp.messagingengine.com [103.168.172.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 10 Jul 2024 14:09:40 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 280BC1381740 for ; Wed, 10 Jul 2024 10:08:14 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Wed, 10 Jul 2024 10:08:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1720620494; x=1720706894; bh=8a3xOaRZyijxFrp03r1rK 7uvs0y77nZ7ihTOZbQ1FHU=; b=hw9HwPN3LYzCDnd7vXvCT7rlIVv6fLvtKEBxo VNzKCEw98heVK01zj8uOGyeEqMmdymAAK70dFSab9EjNval7zyD6HrLCsZCOlcqP r40I3p1wFGhwzNILp0FW4e+J/MXY2qDRA4z81uecR19wUUKPbjsZXbRGiCCvqAap xx01LnVK2T1HOYub2+ShMG4Zftqn75d+vBvuFkJWJtca0dm4hxATvd20m0nyunvB qRS51ZmT70dz0ur7ma2AyaIaxjlqEt78CZk1I3J/mkmh7ZZc/lAXcNMnrEdLWnlC ZJiT9OEukBQY4UlJeAjRcePT2SCkFG9eaS/jJjxFGMXJXvWpQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720620494; x= 1720706894; bh=8a3xOaRZyijxFrp03r1rK7uvs0y77nZ7ihTOZbQ1FHU=; b=a kB7FvwZGRRn+ulvYANf7o/rGGUSXVepKcZ3pnH2XPdLttdTwPLYo9vbwtR6ZIROA 2fLy3btTetwDC2x/o9Brnb8qYeJYm2HBTIRb/DFSjg5QlWvQtV3ZTFTIuBJMXdhl 1RvAoJCmKAMLS/6mn4tWXcWZWdEl1scmioUhv04DQ3BVSjszg7227UBMyBmrfLK4 LNqElK2PPW5RyUzMcPWyrp5ERXkTq1u0ubWScP8v+petPPphScCa+pilfCRfaoQU rIcqdA5ebc83kk5qNjqNGvQ49k02K+fCnpIteZGUPBdjxeGAHf631nIsgQgvQH4R 2FbN3OUvz33sGSf5ExUHg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrfedvgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpefhhedttdeihfetleffvedugeeuiefhleefudeujeef veevfeehfeetvedvueekveenucffohhmrghinhepphhhphdrnhgvthdpvgigthgvrhhnrg hlshdrihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C464F1700093; Wed, 10 Jul 2024 10:08:12 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-568-g843fbadbe-fm-20240701.003-g843fbadb Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <4bf9a581-41a2-41d6-9adc-a5732818d110@app.fastmail.com> In-Reply-To: References: <09559430-4477-4516-8D78-6F4071E1AA6C@newclarity.net> <0182F3D6-F464-477F-9029-A2D0A8B50C71@koalephant.com> <1AFD7AAE-8BEA-460D-88A8-15BB3D30A775@koalephant.com> <7B633CC7-C768-4852-A4D0-B252A04F7DE1@newclarity.net> <0E11F373-99DC-496E-9BBC-2F8688B9F66A@newclarity.net> <4F720A7A-B7DD-4B31-B0C9-6907419B53A5@newclarity.net> <7b40e925-d642-4cf4-83f8-f903a9964362@app.fastmail.com> Date: Wed, 10 Jul 2024 09:07:37 -0500 To: "php internals" Subject: Re: [PHP-DEV] [PHP-Dev] Versioned Packagers (Iteration IV) Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Wed, Jul 10, 2024, at 1:38 AM, Mike Schinkel wrote: >> In fact, if you use an optimized/dumped autoloader, then Composer sim= ply builds an internal giant lookup table of what class maps to what fil= e. PSR-4 is then *completely irrelevant* at runtime. It's already one = giant O(1) lookup map. That can be done *today*. That *is* done today. > > Yes, it can be done today. It *is* done today. By. Developer. Managed= . Apps. > Already done. I explained how an `spl_autoload_map()` would do exactl= y=20 > that above. > >> When you have a proven that it's even possible to have multiple local= symbol tables, we can talk. Until then, please spare us. > > My one useful takeaway from your email =E2=80=94 except that I already= knew=20 > that =E2=80=94 was the need to figure out how PHP can handle multiple = symbol=20 > tables. Beyond that, your take your own advice and spare us (me) from=20 > your contempt and condescension as they are not good looks on anyone. I find it amusing that several of your responses to me saying "you could= do this stupid thing but no one does that" is "WordPress does that thin= g." I make no comment other than to observe it. But let me understand: In a thread started by Michael Morris where he ex= plicitly said the most important thing for him is multi-version loading,= you're going to insist you're talking only about moving Composer's clas= smap logic into core, and nothing about multi-version loading. If that's the case, then please be polite to Michael Morris and get out = of his thread. Also, be aware that classmap-in-core was already discussed 3 years ago a= nd went nowhere. https://wiki.php.net/rfc/autoload_classmap https://externals.io/message/113545 Largely because, as Sara said then, and Rowan just said on this thread, = it can be done better in user-space and is already done better in user-s= pace... by Composer. https://externals.io/message/113569 You even commented in that thread: https://externals.io/message/113554 So it's not a new idea, it's an idea that's already been greeted with a = general "meh". Yes, most "developer managed apps" use Composer today to side-step the "= bajillion autoloaders" problem. It's a solved problem. Nothing precludes Wordpress from doing the same. I admittedly have not = looked at WP's core in a very long time, but I would be absolutely shock= ed if it wasn't pretty straightforward to build code into WP core that l= ooks at the source directories of all plugins, finds the classes there, = and builds a big index (stored in a cache directory or the database) tha= t it can use in one single autoloader registered by WP itself. I know t= hat can be done, because that's exactly how Drupal 7's autoloader worked= . I know, because I wrote it. In 2008. (It was later modified by othe= rs, but the initial version was mine.) That would work even with WP's "download code and drop it on disk" model= . That has been possible since PHP 5.2 at least, when I wrote exactly t= hat for Drupal. It wasn't even that hard. Literally any "user managed = app" could do the same. Why hasn't WP core done that in order to make life easier for plugin dev= elopers and avoid registering 50 separate autoloaders? I dunno, you sho= uld ask Matt Mullenweg. We have nothing to do with it. --Larry Garfield