Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127533 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 7BCB21A00BC for ; Mon, 2 Jun 2025 14:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748875344; bh=xYPwb/MoaUHcP83bw8MFc8xzh3vtg7bxmnF2X4yG6SU=; h=Date:From:To:Subject:In-Reply-To:References:From; b=OZTcS9CJF8VH4vdiIbcOdIVJy1whyNhpCmmuD7IWa+P5ptYvhnaQYCnWCPgMVFgIc NVjmjdFSt8CABlHUabXbwju6XRMPTvM/h2j8LOU8l2ZGi3vKSOTLtWzLn7+sLcIUh9 66eSBUAjdlFd6pCSXNYCrHNj3d47Bh+Azyec0uF+d9MVAJvmRW3E1yTRdl5bLboCBc 4AbvUArcv4CW1NGnyRYMbiSntdCImh8L4zt8KLLctLC3rIASDdBXuAA3k6V1kKi/FQ wMmpKl2a2DIODk9nI3r5XNaooTT3JpJPlqTki0dD/AStm2OBbV4uAQXkfsl26QFS/5 yyZj8KmBX4bhQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A8042180042 for ; Mon, 2 Jun 2025 14:42:23 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS 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 fhigh-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.153]) (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 ; Mon, 2 Jun 2025 14:42:23 +0000 (UTC) Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 961DB1140142 for ; Mon, 2 Jun 2025 10:44:27 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 02 Jun 2025 10:44:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=1748875467; x=1748961867; bh=q/JQKNHNIsKNaWqTX97/qJEbmFxXJAJxYUiR8rdbgko=; b= ql0sf903+WU07umBT2fvgOGwjZ8uEjGBoU3DuddNuABsRdY3eS914jETd6ao6ms9 NZ82Ki7OEzryhdzHH6IejWS904ZAWO1l7rIWOVi8khPnVz49l+gvKb27xsdMBq4k de5Pp0aMqwzFKHJOAjRHkM05NnaYmqIggtDEjQIRZE2ZqPWQPfeZND5sCeld7Uny gmKN/Ev0Nc8Ho870v0p3Ok05yB9fbrEU4d1QIfc/w8teKR2IS+NRuaF+wm+I/RBt VVUSIpEvNb/2GrmmeLuZ1+xSVvMcPCe4Dvo2ArqJhc9u3cmFVvvg4y28/BFZ21Mm T843ZRW2ULn0yxk9j1W6+g== 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=1748875467; x=1748961867; bh=q /JQKNHNIsKNaWqTX97/qJEbmFxXJAJxYUiR8rdbgko=; b=Wrpb4nIBva1cv3e+g ukFFCGCFcLgQFeSxB0svXwWzPJz2WGSULZOwINmeEkVRhsZgbj8nZWagVYxAe4Yx urgQ/LJ1SIJVV6qDEnh8/+5RvZMxnpSrRQ67+j0vedSp6szz7edAsCWRT2HcVbvw KSfocHvotlUn/h+wzyPTGeuFXBAnze66nRVh3FMlOGw/sVLBRQU+FtrTwmkrf5TO yyD6THiddx6sspi5j4uV9gJqgCUNJa1HrmSawtkuMuX6NNlK82OH++tWq5pW2d/i ew1+FLW5TbrQfTRIdui0bOtDSKl8GWDt12ECZa5cNSVSib2EC85hMGwJM22yRKYk aM80w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdefjeelgeculddtuddrgeefvddrtd dtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggft fghnshhusghstghrihgsvgdpuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftd dtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvufgfjghf kfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculg fkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffr rghtthgvrhhnpeehleffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtke evvefgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmh houggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdr phhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 2 Jun 2025 10:44:26 -0400 (EDT) Date: Mon, 02 Jun 2025 15:44:24 +0100 To: php internals Subject: Re: [PHP-DEV] Module or Class Visibility, Season 2 User-Agent: K-9 Mail for Android In-Reply-To: References: <354cb888-97c4-4f8c-a0da-359d1e63c0f9@rwec.co.uk> <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> Message-ID: <894DC5D3-3CDD-479F-BAC1-70EE1AE0C5E2@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 2 June 2025 14:27:45 BST, Larry Garfield wro= te: >Were we to do that, then the consumer container-loading needs to take any= potential module-definition into account=2E Eg, if one class from a modul= e is pulled into a container, all of them must be=2E You wouldn't containerize "something from a library", any more than you co= ntainerize "part of Nginx"=2E You create a container, and put a bunch of st= uff in it *that doesn't know it's running in a container*=2E A Linux contai= ner doesn't know that Nginx requires a bunch of shared libraries and daemon= s, it just creates a file system and a process tree, and lets you do what y= ou like with them=2E Let's say I'm writing a WordPress plugin=2E It's just a bunch of files on = disk, some of which I've written, some of which I've obtained from open sou= rce projects=2E Maybe there's a giant file with lots of classes in, a vendo= r directory I've generated using Composer, some Phar files, and some fancy = modules with metadata files=2E Maybe I distribute an install script that fe= tches updated versions of all those things; maybe I just stick the whole th= ing in a tar file and host it on my website=2E I want to have WordPress load all that code as part of my plugin, and not = complain that somewhere in there I've called a class Monolog\Logger, and th= at name is already used=2E I don't need WordPress, or PHP, to know whether that class is "really" a v= ersion of Monolog, or how it ended up in the folder=2E And I don't need twe= nty different containers for all the different things in the folder=2E I ju= st need to put *that whole folder* into a single container, to separate it = from someone else's plugin=2E The container somehow creates a new namespace root, like a Linux container= creates a new file system root=2E The code inside uses require, autoloadin= g, module definitions, etc etc, but can't escape the container=2E=20 Then in some way, I define what's allowed to cross the boundary between th= e main application and this container - e=2Eg=2E what parts of the WordPres= s API need to be visible inside the container, and what parts of the contai= ner need to be called back from WordPress=2E And that, if it's possible at all, is the plugin use case sorted=2E No cha= nges to Composer, no need to rewrite every single PHP package ever written= =2E Probably some caveats where dynamic code can accidentally escape the co= ntainer=2E Completely separate from the kind of "module" you and Arnaud wer= e experimenting with=2E Rowan Tommins [IMSoP]