Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120323 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1788 invoked from network); 17 May 2023 14:54:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 May 2023 14:54:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 11DB41804F7 for ; Wed, 17 May 2023 07:54:40 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS714 17.58.32.0/20 X-Spam-Virus: No X-Envelope-From: Received: from ms11p00im-qufo17282001.me.com (ms11p00im-qufo17282001.me.com [17.58.38.57]) (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 ; Wed, 17 May 2023 07:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shyim.de; s=sig1; t=1684335278; bh=eNOaCYhbrVz3g7WhRFdUhobFzV7eIHRaU6qu4YxeO2c=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=R5X6H7CVdnI+uddks6ShGYIqZ8zhXGc712HxoddaCsxCvWG9sdLljHRr+owla9Jw7 2+7A/J/ECsVaDdiQoSce8MXxWT55bHPVDyrhPBUGr0/Y3UXZvZ9Sfltyqy9TWh0RXT H+5UMaGpA+Jy5qTJj+NGz+wBfuqXCZjqRb1mN0Gl/qZt/k0d+Ats9E5mhVdSUZcPSX CXrt5Y50RkHjd4nTHfCjKpm6GEyGGETMozNe4pj0hR8Oyx4GSAogeXSQjtx7mQBvui /inUn2+nTfC+X5OwoFndfgenFILv7GL7lRe9wNuSvTxoGoh9FT31XwfYO4L+6CDsUV gq8cU+UAg6dhw== Received: from smtpclient.apple (ms11p00im-dlb-asmtpmailmevip.me.com [17.57.154.19]) by ms11p00im-qufo17282001.me.com (Postfix) with ESMTPSA id C86061E012D for ; Wed, 17 May 2023 14:54:37 +0000 (UTC) Content-Type: multipart/alternative; boundary="Apple-Mail=_5D3BA841-873A-4057-950E-B794C2EA6DCE" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Message-ID: <4ECF6970-2A01-4C47-9B41-87D534F54CB8@shyim.de> Date: Wed, 17 May 2023 16:54:25 +0200 To: internals@lists.php.net X-Mailer: Apple Mail (2.3731.600.7) X-Proofpoint-ORIG-GUID: oZyet3SusvlCVX5seOkOpLiYmVSL0G5I X-Proofpoint-GUID: oZyet3SusvlCVX5seOkOpLiYmVSL0G5I X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.138,18.0.816,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-18=5F01:2020-02-14=5F02,2022-01-18=5F01,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 mlxlogscore=367 spamscore=0 clxscore=1030 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2305170120 Subject: [RFC] path_join function From: php@shyim.de --Apple-Mail=_5D3BA841-873A-4057-950E-B794C2EA6DCE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey, I have created on GitHub a feature request for a path_join function = (https://github.com/php/php-src/issues/11258) and got the label that = this requires a RFC. So I am here now :) The idea is to provide in PHP itself a function to join filesystem paths = (idea: path_join) like in other languages, node as example = (https://nodejs.org/api/path.html#pathjoinpaths). For me this function = is some kind of base filesystem functionality like basename, realpath. Example usage: path_join('/base', 'my', 'path'); // /base/my/path path_join('/base', 'my', 'path', 'test', '..'); // /base/my/path Why not just string concatenation? When you concat just the paths you have to think about: - normalize string part to strip ending slash - for windows compatibility you have to use DIRECTORY_SEPERATOR I think this can improve the developer experience when working with = filesystems a lot and people can delete their implementation. I am really looking for your feedback, right now I have no =E2=80=9Ckarma = points=E2=80=9D to create a RFC in the wiki :) Thanks, Soner= --Apple-Mail=_5D3BA841-873A-4057-950E-B794C2EA6DCE--