Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127548 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 lists.php.net (Postfix) with ESMTPS id 7B3E81A00BC for ; Tue, 3 Jun 2025 02:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748918267; bh=3R0Obxm+y+Q9hemuPQplKJOrGtgFCqleGM43L0gIeW4=; h=Date:From:To:In-Reply-To:References:Subject:From; b=WYN8SOJs6Hvh7hBajwQyPh6aReQgjtGel6nWz0OegBL2brG2+FfvuZKHQELiLzoXm ZHEXqB6V00dYCkQugc1lp0CHF9jYLFQFPhhnSQuokC2LCOY4m04l79yC2OluC50LfW 9sQQc/6i2RakgZvhkpAOW/DKK8i53qL8DI4+A4v1Uqp+4VquJqSRFDu1hepkVhdyOJ Vk3+xGOUz64IW1Y1BLWZtZa7VmDIlKV3ePqc1CBV+NK5JJZlWhnEl6auxu1Lr7Mdfk loCzx++Yrjkb9RXIW4UdKttap8gswz7H5aBB9d/A+c08JRgDXHvvbzpJ3NQwg0O1hE m0lgLzmOz1Hww== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 75137180042 for ; Tue, 3 Jun 2025 02:37:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 3 Jun 2025 02:37:43 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 2714B13800BE for ; Mon, 2 Jun 2025 22:39:47 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Mon, 02 Jun 2025 22:39:47 -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=fm1; t=1748918387; x=1749004787; bh=ymqOOlqXUSbKDeEyKeK4S W01TI89S79HQw0OL62AU3I=; b=S+vL1ytVtlfh1YSdxHkVMPrz9ljDiIUycn/RR cO+ZTj55nW+jzP4ZgC8RCa9SdLt003QoxcWo0ALja0JjZMWJvosx6l5MPXCNyBpo yZTUMZs7gHYfHU/Re/r6h9u3YEUUdW6/w++nbmpJqCdNuBp368mNHP/9/di5Ea2h h3bpKoWYDJjQEBxfv61NxuAKAMaQDKoE1fvSy56S73K4ir19xGuaDmvj9GdwSyoV 1TDmmW9vj9RBjGxcusJWJgiN/TM1SNXs/iGa/3koBRWwoe/mxmfIH/mDySwixACs O2z7fpUpWOC5zzEJONVblXiqZIzfV0PEQwoo5pouWIkWhg4IA== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1748918387; x=1749004787; bh=y mqOOlqXUSbKDeEyKeK4SW01TI89S79HQw0OL62AU3I=; b=pxhT69mtY2hxE7G6S 4BL9vYJ9viy7BL5o7jW5OXu3N5Y6UpXT+NhUxOghFeqLpU17d7ZTrnkBqjl8h7kl yjMYjqEH04jT4RdDMYgUedU3r8yKvt/S6wtvbGoecvwbKv6AQ/TA/FNjv5YghM7A KOXvmSf4xC6dMK1JmTaqbWRNVAiVH4RvzJKsz5PPyqTNlLig/EYMFFU39OCs5kBQ 501beoe8nLvIWCBNXTRcdsKULVYMDxvjWDOnLyrzey3WKDD4oVH8Snbdcbpm47l4 uyBNKU48/8fooHrDUH8LWUym+3xY4w1w98I1tOzqY2iUgOKFnUpBXXSDtDAjkama xVGQw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdefleefkeculddtuddrgeefvddrtd dtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggft fghnshhusghstghrihgsvgdpuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftd dtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgj fhfutgfgsehtjeertdertddtnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufd cuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghr nhepudegvdelgfeugeehfeejteffudevleethfefgeejffffleegtddtveekgeekudfgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhr hiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvg epshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhp rdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id C0F45700060; Mon, 2 Jun 2025 22:39:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: Te4ea9ce7af33d8fb Date: Mon, 02 Jun 2025 21:38:58 -0500 To: "php internals" Message-ID: In-Reply-To: <57d08124-fb6a-4e0b-8d42-bdb645571b13@rwec.co.uk> References: <10D95B6E-094B-4EAE-A18A-AF6B795CB352@rwec.co.uk> <2adbff61-5e11-4d39-ab5c-d7950a4550a6@app.fastmail.com> <79E7FA26-2F5A-470C-B1DF-12CC46A08FE5@rwec.co.uk> <1c6dcd84-9016-48e1-971f-de7749cbdce8@rwec.co.uk> <44F59416-3922-4AF4-881A-C64F2C4E9345@rwec.co.uk> <7F11844A-A98C-4843-BC94-815FBCD2B73F@garsi.de> <7840468C-F60C-4A44-AE40-16F9007EF428@rwec.co.uk> <160E9B1D-9AF6-479B-A628-A73C618D7C1B@garsi.de> <2c5c241c-bd05-4200-b6ee-e94c8ab0db1b@rwec.co.uk> <894DC5D3-3CDD-479F-BAC1-70EE1AE0C5E2@rwec.co.uk> <5eb5b1b4-7cb2-4a2b-afdd-ad3e83ae856d@app.fastmail.com> <57d08124-fb6a-4e0b-8d42-bdb645571b13@rwec.co.uk> Subject: Re: [PHP-DEV] Module or Class Visibility, Season 2 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jun 2, 2025, at 3:28 PM, Rowan Tommins [IMSoP] wrote: > On 02/06/2025 17:57, Larry Garfield wrote: >> Well, now you're talking about something with a totally separate compile step, which is not what Michael seemed to be describing at all. But it seems like that would be necessary. > > > There's definitely some crossed wires somewhere. I deliberately left > the mechanics vague in that last message, and certainly didn't mention > any specific compiler steps. I'm a bit lost which part you think is > "not what Michael seemed to be describing". > > > > Picking completely at random, a file in Monolog has these lines in: > > namespace Monolog\Handler; > ... > use Monolog\Utils; > ... > class StreamHandler extends AbstractProcessingHandler { > ... > $this->url = Utils::canonicalizePath($stream); > > > > My understanding is that our goal is to allow two slightly different > copies of that file to be included at the same time. As far as I know, > there have been two descriptions of how that would work: This is what I was getting at. As I understand what Michael's examples have described, it allows pulling a different version of one or more files into some kind of container/special namespace/thingiewhatsit, at runtime. I fundamentally do not believe pulling arbitrary files into such a structure is wise, possible, or will achieve anything resembling the desired result, because *basically no application or library is single-file anymore*. If you try to side-load an interface out of Monolog, but not a class that implements that interface, now what? I don't even know what to expect to happen, other than "it will not work, at all." The *only* way I can see for this to work is to do as you described: Yoink *everything* in Monolog, Monolog's dependencies, and their dependencies, etc. into a container-ish thing that gets accessed in a different way than normal. That doesn't force Monolog to change; it just means that the plugin/module/library using Monolog has to do the leg-work to set up that package in some way before getting to runtime. It can't just say "grab these 15 files but not these 10 and pull them into a container," since it doesn't know which of those 15 files depend on those 10 files, or vice versa, or what other 20 files one of those 15 depends on that's in a totally different package. That's like trying to containerize pdo.so and xml.so, but not PHP-FPM or pdo_mysql.so. Technically Docker will let you, there's just no way it can lead to a working system. So if it would require globbing together a long chain of dependencies into a thing that you can reliably side-load at once, and expect that set of packages/versions to work together, then something that builds on Phar seems like the natural way to do that. Essentially using Phar files as the "container image." You're right, that may not be how Phar works today. But building that behavior on top of Phar seems vastly easier, more stable, and more likely to lead to something that vaguely resembles a working system than allowing arbitrary code to arbitrarily containerize arbitrary files at runtime and expecting it to go well. --Larry Garfield