Re: [PHP-DEV] Filesystem path APIs

2023-12-10 Thread Erick de Azevedo Lima
I'm in favor for this. I think that, since you already have a built-in file API, adding useful functions is always good. I use *\str_starts_with* and *\str_ends_with* a lot in my code. In Laravel, which is the most used Framework these days, you have the \Illuminate\Supports\Str::startsWith and \Il

Re: [PHP-DEV] Filesystem path APIs

2023-12-09 Thread Niels Dossche
On 12/9/23 10:40, David CARLIER wrote: > On Fri, 8 Dec 2023 at 16:10, Niels Dossche wrote: > >> Hi David >> >> On 08/12/2023 10:08, David CARLIER wrote: >>> I think these would be great additions to PHP as working with paths >> and files is a core part of any programming language. >>> >>> >>>

Re: [PHP-DEV] Filesystem path APIs

2023-12-09 Thread David CARLIER
On Fri, 8 Dec 2023 at 16:10, Niels Dossche wrote: > Hi David > > On 08/12/2023 10:08, David CARLIER wrote: > > I think these would be great additions to PHP as working with paths > and files is a core part of any programming language. > > > > > > Seems like it, is there an argument to be made

Re: [PHP-DEV] Filesystem path APIs

2023-12-08 Thread Dusk
On Dec 8, 2023, at 09:13, Pierre Joye wrote: > if any of them could be a easy win, relative path resolver without checking > its existence would be one. It is available internally but the existence > check option is not exposed. Are you thinking of realpath()? That also expands symbolic links, wh

Re: [PHP-DEV] Filesystem path APIs

2023-12-08 Thread Pierre Joye
On Fri, Dec 8, 2023, 3:44 PM Max Semenik wrote: > On Wed, Dec 6, 2023 at 10:20 PM Niels Dossche > wrote: > > > Hi internals > > > > I'd like to start a pre-RFC discussion about filesystem path APIs in PHP. > > The reason I bring this up is because of this recent feature request: > > https://gith

Re: [PHP-DEV] Filesystem path APIs

2023-12-08 Thread Niels Dossche
Hi David On 08/12/2023 10:08, David CARLIER wrote: > I think these would be great additions to PHP as working with paths and > files is a core part of any programming language. > > > Seems like it, is there an argument to be made to, let's say, in the > performance side ?  A native implem

Re: [PHP-DEV] Filesystem path APIs

2023-12-08 Thread David CARLIER
Hi Niels, On Wed, 6 Dec 2023 at 19:20, Niels Dossche wrote: > Hi internals > > I'd like to start a pre-RFC discussion about filesystem path APIs in PHP. > The reason I bring this up is because of this recent feature request: > https://github.com/php/php-src/issues/11258 > > The feature request i

Re: [PHP-DEV] Filesystem path APIs

2023-12-08 Thread Max Semenik
On Fri, Dec 8, 2023 at 11:45 AM Lanre Waju wrote: > So your suggestion for simple file stuff is to download composer? > Not necessarily, but I'd like to have more discussion of pros and cons. -- Best regards, Max Semenik

Re: [PHP-DEV] Filesystem path APIs

2023-12-08 Thread Lanre Waju
So your suggestion for simple file stuff is to download composer? On 2023-12-08 1:43 a.m., Max Semenik wrote: On Wed, Dec 6, 2023 at 10:20 PM Niels Dossche wrote: Hi internals I'd like to start a pre-RFC discussion about filesystem path APIs in PHP. The reason I bring this up is because of t

Re: [PHP-DEV] Filesystem path APIs

2023-12-08 Thread Max Semenik
On Wed, Dec 6, 2023 at 10:20 PM Niels Dossche wrote: > Hi internals > > I'd like to start a pre-RFC discussion about filesystem path APIs in PHP. > The reason I bring this up is because of this recent feature request: > https://github.com/php/php-src/issues/11258 > > The feature request is about

RE: [PHP-DEV] Filesystem path APIs

2023-12-07 Thread Jeffrey Dafoe
> The feature request is about the following: > We already have some functions to work with paths in PHP, e.g. basename, > dirname, realpath. > We do not have some common path APIs that you can find in other languages > like: path_join to join paths and path_normalize to normalize paths. ... > Wha

Re: [PHP-DEV] Filesystem path APIs

2023-12-06 Thread Ayesh Karunaratne
> > There could be OOP-style alternatives too, e.g. Rust has a PathBuf struct > with methods that are used to build paths. > However if we were to choose this route then we need to be aware that > interoperability with existing filesystem functions would be much harder > because they all work di

[PHP-DEV] Filesystem path APIs

2023-12-06 Thread Niels Dossche
Hi internals I'd like to start a pre-RFC discussion about filesystem path APIs in PHP. The reason I bring this up is because of this recent feature request: https://github.com/php/php-src/issues/11258 The feature request is about the following: We already have some functions to work with paths