Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124123 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 5E2DF1A009C for ; Mon, 1 Jul 2024 02:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719800027; bh=CQKL+VmHMYhKVrweqf+qD6LRwBe/IOHW+2F9hHMqUWE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=DIezEZ8A9I+4LOjGkrWJCQzkZXGamSJMaoM3MBH92NSImTmSbmogOX6fiUFnceSgu UqSd2NeYDreWsbZzMseFxvXdxZKd9SeuQDzqIbycnxZieH811H55Pbm9tpx4btPyud NeLa5sZVSVOCq3/If5xLkupA4T1UGEcMZOJ5bIwq6JONy8QhUOQcD2sYQUNyja3EUp ZrSbl3CKLZB9rmI4JFuozBki7LhZoPEJE9gTjm1yqIwUomzITJRXeWl3t5wE6sWAOu zVMSCuiqBQJ1EFeHXOt+6UeAFTHFcz9TDeA5VfWDO6m0kXM7vYe5RByxqV55l4MEmv MjxC+n7TjU84Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2F93E180555 for ; Mon, 1 Jul 2024 02:13:46 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (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, 1 Jul 2024 02:13:45 +0000 (UTC) Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-64b29539d87so20667277b3.0 for ; Sun, 30 Jun 2024 19:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1719799945; x=1720404745; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3qN9buOietp4i3tOkCK8gdzhnD9kaAZR71Xm5pj+7Ho=; b=LXIwaeb9Uy7qj9Yi98KAEI2Q65/phUZ3hXqMZlRacRiVzRw12eXx076VOZQPMr44KK QTurZpwaL09utclGMoseeHsFwKvNlaJNAs11XOl67/m9QOAnuOK7fQyL2YMx6l2sBbS+ /4/uaw/B3LLiyH2465prQwrr4Mko5FTqD4RwpxoroAlsGydjodikdhpyTS0CuUvp6kPL 9AuzodRpXFheM4yFObO3Onphmh8He+dSlto+ZVx26ah5qGoaYS1VhmTUEdIeMJHu7QRp BqEdHOyszslWJLiCjSZ5pcOG0VLS7QA1EqYGrHlwJaEcL/nlzSCZs6UQ2L5uCrcGMZvO R6Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719799945; x=1720404745; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3qN9buOietp4i3tOkCK8gdzhnD9kaAZR71Xm5pj+7Ho=; b=T5Z1eNKP04mkFixv075dLj9CJcMIygUe2FiKU4inQ1UZ5RmLgxEOBR4C3D0d3cz4PY tXFGf7XSCurmNhEb6DrLKKqupJB7z5j87rfXZ99bLJWr51xcEkmom6qEvkhT/rbverVX 6QCKtNWIH5tMNhMHyy40HpA/7sO9MOBZNAUYkU+EfacdOL26M2kY/wgLHWMJx2tdIIKq NY72I3dsFnv6/UbfzgTXTHSvtvJd77gd6kPRhlq9azj2n8tRC/EUQREJUWHLhSYmk1+w 8oQAyTWLTu9MrYZWePATQSABZtW3wlM2j9fy6ADtu7tJ9zUvBo79+tZ5Jf/lnL/ltQIz ff+A== X-Gm-Message-State: AOJu0YzS/FakjvMJFW9Y2BDoN/KfhR1uNjY6vL5WXEZgwROGidguu4s8 ++vXYmB7AeafcvPm9Ugfj6ocDa1H2kSasoxI9aGJYR6D4gcWujso3n6X7JstduM= X-Google-Smtp-Source: AGHT+IFLzNxcQ/7giGlDzLlQvN65BHcFoayaXTk4i+ep0eAAYrA8DoqJHqtmnneBHS26gEiAjoNvVQ== X-Received: by 2002:a0d:eb93:0:b0:644:4b82:bb0a with SMTP id 00721157ae682-64c720b8173mr43828557b3.2.1719799944616; Sun, 30 Jun 2024 19:12:24 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 00721157ae682-64a9a331e33sm12128827b3.58.2024.06.30.19.12.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Jun 2024 19:12:24 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript) In-Reply-To: Date: Sun, 30 Jun 2024 22:12:23 -0400 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <1917CF7C-26D8-4DBE-B05C-5AA650AC6C9F@rwec.co.uk> <551cd5b0-1c00-4818-a9ca-97f6b7e8c3dc@app.fastmail.com> <39B496F8-062E-4848-9B3B-529BE8D3415A@newclarity.net> <856F4F70-DC81-4098-82DD-5F6D47CDF3F0@newclarity.net> To: Michael Morris X-Mailer: Apple Mail (2.3696.120.41.1.8) From: mike@newclarity.net (Mike Schinkel) > On Jun 30, 2024, at 4:28 PM, Michael Morris = wrote: >=20 > So let's take another crack at this based on all the points raised in = the thread. This should also underline why I don't consider this an RFC = - I am iterating until we arrive at something that may be refinable into = an RFC. And I say we because without the aid of those in this = conversation I would not have arrived at what will follow. >=20 > Before I continue I would like to apologize for being somewhat = irritable. We're all here because we enjoy using this language and want = to see it improved and prevent bad changes. Opinions will differ on this = and in the heat of the moment of arguing a point things can get = borderline. >=20 > Returning to a point I made earlier, Composer isn't used on Wordpress. = I went over to the Wordpress discussion list What?!? No good WordPressista would be caught dead using an = uncapitalized "p." https://developer.wordpress.org/reference/functions/capital_p_dangit/ Have you no shame? ;-) > and read over why, because that discussion provides clues to what = kind of package management may be adoptable. I think the largest point = is that Wordpress should be usable without ever resorting to using the = command line. Yes, it does have a command line tool - wp-cli - and it is = powerful, but using it as an administrator of a Wordpress site is not = required. But seriously, I think the issue is not the CLI usage as Composer could = be included as library in PHP if it made sense. The issue is different = plugins loading different versions of the same dependencies, something = that Composer delegates responsibility to the developer to resolve = because PHP does not provide package-level scoping... > * PACKAGE SCOPE - Each package brought in with import gets its own = package scope. This is a distinct behavior from Include/Require. I think = each package scope will need to be on its own request thread, but this = is an implementation detail I can't speak to with any authority. The = goal is whatever happens in a package stays in the package. If two = different packages want to define /foo(), they can. Yes, package-level scoping would be useful.=20 However, maybe we could first focus on how to get "package" scope as a = much smaller scope as a starting point? No pun intended on "scope." :-)=20= Constrained scoped should be orthogonal to namespaces, and also thus = support namespaces as both Rowan and Larry have explicitly said they = want. > When a package is imported the parser will look for a `.php.mod` file = at the root of the package. Among other things, this file details what = type of package it is and where to mount it by default in the namespace = of the ROOT SCOPE. I (obviously) like the idea of a `.php.mod` or differently named file = that PHP would get site and/or directory information from. Such as = pre-compiled equivalent to a `.phar file, but then it would not be a = text file as you have proposed. I do think having the version of PHP = expected would be interesting which would define the author's intent =E2=80= =94 assuming they maintained it =E2=80=94 and could allow multiple = versions of PHP running on the same server. However, I do agree with Rowan that trying to create new functionality = that differs from Composer is likely destined to failure. And if PHP = allowed package-level scoping then Composer could likely resolve the = issues that WordPress faces without needing a new way to manage = packages.=20 (I really wish Composer supported direct package reference via URL = rather than only supporting registries. But I digress.) -Mike=