Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118659 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24544 invoked from network); 19 Sep 2022 16:45:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Sep 2022 16:45:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5C00A1804AA for ; Mon, 19 Sep 2022 09:45:48 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 ; Mon, 19 Sep 2022 09:45:47 -0700 (PDT) Received: by mail-pj1-f46.google.com with SMTP id fs14so158125pjb.5 for ; Mon, 19 Sep 2022 09:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=b8dXq3SPsm07W1RxmarmC7qugPMAXneZ95UAV8wLGX0=; b=EMZ8+fzwIem4xu/6E1v4Liu0bqIyQ7rnbceENQLZ7wfMOkzqqudWB1BX5/F9AP1Qsz VlRg4D31giitvGMG9afDxB9furCzFjXNLooUuoZNMEzU39nYPdoXR+ND3kf1zKgTP7dj JtBh+hxyOFBscuo3ujAw6wxV9g+ZUDwJKVjDvHHXHAW+B6iUHXCQizULOx1b86kNwZQF pRLb7b0wHYE1kxQMo+4VkH9j0hjQPHCD0EO1nD8SNefMTz2AcNvAl5xKEiocyydgjMyL xfN6W1DEhFd5vU4wU8CV2Rdav1c7qJgH9CGlk0fcbA1HvlM97hhbt0ArmV9ed4L163ey cGFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=b8dXq3SPsm07W1RxmarmC7qugPMAXneZ95UAV8wLGX0=; b=XBLEFwu9cvkn+i3wcoVXGdD2PmoSJe2d90w0+jGXiQZiYjatXiTqbI597qABVWgIAX qHCO6mpYzR6JR7UoB3AFv3EzbGAFKebpIHqFSt5SaHwa+vAad2XhWy7Yk1EZrUzoaEu7 BM4sX1f4xpXI/whgn8N7RITiBaTeQLSBx6DlqjdI2L2TdvT4vpSfkqA1n09d34iXV+k2 76lt8USLO0WM9pm3yTdCP300bmL+KRzl5yHJJcoclpRKIiHX53WcgbGKixpW7i2eyod3 W24LQ21928xX7KgX4ShMyA4KG+GbggD9XIdWQgQhKttSsRaP6H0R/Y4UwvQ2MrgytVk1 U6mA== X-Gm-Message-State: ACrzQf23oPR/EY7phjw+ts0UQ5dqXM7b3nDeegOc0U1JRxfYfaZ2FByx 60Fi+G2GW7iWN3Zq1sxr2/X7eV4+zJe+UE4N+mVRgaWs2CQ= X-Google-Smtp-Source: AMsMyM72R7zPne1OTX00Lwa4rgo5maJvKNhM7uNmC0sB7IfU34x3aFB+vMr1Kku2OFM3lx11lwB3+Vt6m1XOtplhHCw= X-Received: by 2002:a17:90b:4b46:b0:202:7a55:5588 with SMTP id mi6-20020a17090b4b4600b002027a555588mr20564009pjb.55.1663605946574; Mon, 19 Sep 2022 09:45:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 19 Sep 2022 18:45:35 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000007debe605e90a7117" Subject: Re: [PHP-DEV] RFC: StreamWrapper Support for glob() From: timmy.almroth@gmail.com (Timmy Almroth) --0000000000007debe605e90a7117 Content-Type: text/plain; charset="UTF-8" > I was using "we" in a more collective sense to mean "us as a project when > writing any RFC". The mechanics of wiring in a method in a wrapper to be > called as a proxy from a global function isn't hard. What's hard in this > case is defining what is expected from that function, specifically what a > typical user might expect. One might expect glob('https://www.php.net/*') > to return all names of all root pages on the site, and perhaps all short > aliases as well (which effectively includes all functions and classes). > There's no way a StreamWrapper implementation can accomplish that in the > general case, the protocol simply doesn't support it. But okay, we don't > implement it for http(s), but maybe we do got ftp(s), and might as well let > end users decide when they have a custom wrapper where it makes sense. > Cool. I'm just saying write all that out and put it in the RFC. There's > no need to know C or PHP's internal APIs to write that much. Write out the > API from the user's point of view, what assumptions you're making about > their use cases, and what risks are presented by cases like http(s) where > we won't be able to pull off a meaningful implementation. > Whether a streamwrapper can be used with glob() or not is not a limitation of the intended glob() implementation, but a limitation of the StreamWrappers themselves. The problem already applies to scandir() today. scandir('ftp://.../') would only resolve contents if the streamwrapper supports it. Someone can substitute PHP's streamwrapper for ftp with one that does resolve content. I'm not sure how many would attempt these border cases, but the documentation could state some words of advice. We could list what streamwrappers that work out of the box, or vice versa. I would not change the way glob() returns data. For invalid paths or streamwrappers it would just continue to return an empty array() like it does today. I edited the RFC to mention these edge cases and limitations. And how they would be handled. If you feel I missed something out I'm grateful if you wanna send a few words fit for copy and pasting to the RFC. /Tim --0000000000007debe605e90a7117--