Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120329 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14391 invoked from network); 17 May 2023 16:24:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 May 2023 16:24:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 857BD18054D for ; Wed, 17 May 2023 09:24:30 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS36483 23.83.208.0/21 X-Spam-Virus: No X-Envelope-From: Received: from caracal.birch.relay.mailchannels.net (caracal.birch.relay.mailchannels.net [23.83.209.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 17 May 2023 09:24:29 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|gunnard@gunnard.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 2D17E8C26CA for ; Wed, 17 May 2023 16:24:27 +0000 (UTC) Received: from pdx1-sub0-mail-a206.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 6B1798C18EE for ; Wed, 17 May 2023 16:24:26 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1684340666; a=rsa-sha256; cv=none; b=MYkP47+nzqSSPVo6PUhhnOVRfExP9RaT8vCn/X8rn4qrFnMhpT9bxGnv/QSQa1hgQ+li59 jnjDzdh70UpDPd+GzCdKpv5cIDwCv0e0FD9IkOlYHMhCEm9yzQ67fzlzixoLgbRKkvd4gr d/Wz9qqGtLXaRFaP+Ob02rdBh+KxveBS7yBFwHkmrDirGtTM4dTlvhQoIefJEXjMPVusql zaSl+A3pbo2drlhjw2ImnSSVcAvQrWP4UuW9z4jlQOAWXGryPy04YCrVrakuvry1uNBoQw YdoP1w5qnQSJPpymCMKQ9nJHJYeD2KXQ/aA4EH14AMP9SfmFmxaqtTZRJdiJIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1684340666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZpB7A2BRM6LuceCInzDf6W/wBka0XsDUDv4/1haWiPs=; b=7nPwpr2g7EK2p62AmNs8nENYkmpviMa3ftU+P8q7+tCtXh0EzUgwYNzkjQeTouh4Ai99e2 f/nUdG9uJDEN6OET5Qivxi0ahxTJTYhXl560wLOeE03OEDvdxGDZzWgW+SbR5FShna/0b6 qputpQI8u/Xf5JY333yQvRcRVN2X6wBFMRxx5kOL0DXREUognCfu9Q3b3DYdU14B4RUhOG prm1JKhb6/docOhcd0ENzJpEnAN4gEDbDfer6opAXyYiAICUY08Z/4d9svzobLstbg9WWU iLmbXZuGpxpg/dRAMBnT3+84kNT1ZKFPwWHyrKIvgkGC8gzEspdUml/WSRS//A== ARC-Authentication-Results: i=1; rspamd-79bb5575d7-h6ptg; auth=pass smtp.auth=dreamhost smtp.mailfrom=gunnard@gunnard.org X-Sender-Id: dreamhost|x-authsender|gunnard@gunnard.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|gunnard@gunnard.org X-MailChannels-Auth-Id: dreamhost X-Hook-Stretch: 4488475b51dc9cfa_1684340666883_212518797 X-MC-Loop-Signature: 1684340666883:4173761980 X-MC-Ingress-Time: 1684340666883 Received: from pdx1-sub0-mail-a206.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.97.48.120 (trex/6.8.1); Wed, 17 May 2023 16:24:26 +0000 Received: from [172.20.5.188] (unknown [50.219.178.70]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: gunnard@gunnard.org) by pdx1-sub0-mail-a206.dreamhost.com (Postfix) with ESMTPSA id 4QLz2f0lkXz7y for ; Wed, 17 May 2023 09:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gunnard.org; s=dreamhost; t=1684340666; bh=ZpB7A2BRM6LuceCInzDf6W/wBka0XsDUDv4/1haWiPs=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=lcp931YOVsITx0KpSj/eGRYqfsSPwDhWX/4A3C1gnPwx9lpl0z1lwm3DSO7Vl8CQT 6aM77PBMPPaA1lfEWj7CK+FAEViuJUhH0eIGpEr+45xtJyEzEt/rLJJrezSdGJ90Ex DoD9XeeZqM7GoF/0P3HhHSqtsCOS81o47XGBqI0OP+mjARaCwpT6+299jTi3QLirKo QjFDn921LK1jCgCp2KMNAJIE6T3YulAl4MeBtlnWrXDBRCxm4Ti2R0hupVuo7PtK7A JWI2PIbK28ODQeh9Vtn5oTtHOq69eC4YLM8VFzhC7GhQIaSCVd6p8B9UXngP0zRVqg pCfzpLcMJhVmQ== Message-ID: Date: Wed, 17 May 2023 11:24:25 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: internals@lists.php.net References: <4ECF6970-2A01-4C47-9B41-87D534F54CB8@shyim.de> <35a55420-5b12-c811-1ff4-c41d29f3a0c6@bastelstu.be> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] path_join function From: gunnard@gunnard.org (Gunnard engebreth) hello! On 5/17/23 10:53 AM, Mikhail Galanin via internals wrote: > Hi, > > Thank you for the proposal - it echoes somewhere inside me. > > Just a little side-view of the problem... > Personally, I will be a fan of Kotlin-style Path API > > E.g., the path is an object so we can get path items, and get > sub-path/resolve child nodes. > It appeared to be quite useful in practice. > > Examples: > - https://stonesoupprogramming.com/2017/11/27/kotlin-path-interface/ > - https://www.baeldung.com/kotlin/kotlin-path-api > > > On Wed, May 17, 2023 at 4:36 PM Tim Düsterhus wrote: >> Hi >> >> On 5/17/23 16:54, php@shyim.de wrote: >>> When you concat just the paths you have to think about: >>> - normalize string part to strip ending slash >> Why is it necessary to strip the ending slash? >> >>> - for windows compatibility you have to use DIRECTORY_SEPERATOR >>> >> I don't use Windows, but to the best of my knowledge, using the '/' is >> equivalent to the backslash. Is there a case where the difference matters? >> >>> I am really looking for your feedback, right now I have no “karma points” to create a RFC in the wiki :) >>> >> If you want to proceed with an actual RFC, the folks handing out the RFC >> karma would need your Wiki name. >> >> Best regards >> Tim Düsterhus >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: https://www.php.net/unsub.php >> > Maybe im missing something here but the already available `dirname()` does this. right? https://www.php.net/manual/en/function.dirname.php