Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120324 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3879 invoked from network); 17 May 2023 15:09:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 May 2023 15:09:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6E6FE1804D7 for ; Wed, 17 May 2023 08:09:53 -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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,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: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (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 08:09:52 -0700 (PDT) Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-ba829f93da3so1145602276.1 for ; Wed, 17 May 2023 08:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684336192; x=1686928192; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hNCpKdOU0Mf9qFDyoMaHtJcThBDHpDrkxPHImjAD/nY=; b=TgzlMLirmNaw2n8JnQbBaXI0Cv2xFBpu4qmiXuYWpnG4Gy/mcZQwa9F5a2m0pqtJYc //vP0FyZByCDUvhkgCLsg3RVzCrYitUiLzOnhebkH0ZFBNKVkR4mgVMoagQI3J9C5lxc 0SdlDkSISGIQ8IYXA5zW1kW5S9IWhBRsN6yivOqBkFp20nxzEeI5TztR63YIcHt81cU4 MWjFsxSqr7Vh1vChJT5ZUN10XYbnT43f9HFl6FyBCZFM9TlRg/uDBaX9imillE6GfiQ8 USAvMGv03zv0h0miLX4wJZblpvl2IeM4dd5tut7pa53lkyLB8OsSULI1ZAMshUODDgwE rTQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684336192; x=1686928192; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hNCpKdOU0Mf9qFDyoMaHtJcThBDHpDrkxPHImjAD/nY=; b=B4H8Cd4OfMOas5DRD2MkQWuvBn0xhghyg4JT4HzTcQXOE95MaxRGBHXdqCHa0s07CQ n6OtocXqtV76biBaZnmDdfz0EuaqxsCf4RB9hy7yDQB9p8rXjq+QslOcSaGlW/ga450e hHKDNO5dzoAqElxB9hkx4BmCkL3xI6gJfr3vt0z25WojYBQWsTrYNRGdDvOuZYKAhTDV PMNYzxfjCb+SKC8sKVCfk8u4DlXpVLg6xdG5tmpRLbsT8sNzoc3gGxIcttdy3fVLZkIJ oi5Ypy+UsyeQuXVNca6KQqVQ4nnFhr2tlJW0jaG8RQjiayOgue16cpTHPuVFqjKYW36I F/xg== X-Gm-Message-State: AC+VfDxwC/OPlYA7QUYDYzuF6EivppfRyJqhvxEqihymxUJ4RJ7ViNIj Xedz1v9X8r+87K+Q8nWGyChylowTI9/2cPxwXuE= X-Google-Smtp-Source: ACHHUZ7ZvtehRyo+CUjQJgwVs1KC3vK3jyWkkXb7C6JrDOwiSXrcflQhs5y9RXURepnKhwl5nOEn1bE9T8ZIw/q1xwY= X-Received: by 2002:a25:cd03:0:b0:ba2:d9f4:bcac with SMTP id d3-20020a25cd03000000b00ba2d9f4bcacmr20885080ybf.48.1684336192055; Wed, 17 May 2023 08:09:52 -0700 (PDT) MIME-Version: 1.0 References: <4ECF6970-2A01-4C47-9B41-87D534F54CB8@shyim.de> In-Reply-To: <4ECF6970-2A01-4C47-9B41-87D534F54CB8@shyim.de> Date: Wed, 17 May 2023 17:09:25 +0200 Message-ID: To: php@shyim.de Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000068ef2e05fbe514b7" Subject: Re: [PHP-DEV] [RFC] path_join function From: kjarli@gmail.com (Lynn) --00000000000068ef2e05fbe514b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 17, 2023 at 4:54=E2=80=AFPM wrote: > 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 I would like to have such a feature in php so I can ditch my own implementation. --00000000000068ef2e05fbe514b7--