On 4/2/2017 8:28 PM, Rowan Collins wrote:
> On 02/04/2017 09:09, Fleshgrinder wrote:
>> Your strategy works in these examples, but the example I gave was
>> different. Imagine that we have `/a/b/../c` which we would normalize to
>> `/a/c`. However, the `b` component is actually a symbolic link to `
On 02/04/2017 09:09, Fleshgrinder wrote:
Your strategy works in these examples, but the example I gave was
different. Imagine that we have `/a/b/../c` which we would normalize to
`/a/c`. However, the `b` component is actually a symbolic link to `x/y`.
Hence, the real version of the path is `/a/x/
On 4/1/2017 6:15 PM, Anatol Belski wrote:
> Basically, it is the same as your points 8., 9. and 10. - it deals
> with the given path itself, so no symlinks, etc. In the snippet
> /a/b/../c it's parsed like follows
>
> - parse up to /a/b/../ - scroll back to /a - append the remain so it
> becomes /
> -Original Message-
> From: Fleshgrinder [mailto:p...@fleshgrinder.com]
> Sent: Saturday, April 1, 2017 2:43 PM
> To: Anatol Belski ; Rasmus Schultz
>
> Cc: PHP internals
> Subject: Re: [PHP-DEV] Directory separators on Windows
>
> On 4/1/2017 2:01 PM,
10 thumbs up ;-)
But this really demonstrates how badly we need this function - I bet any
number of those points may or may not be covered by any number of
implementations in the wild.
It would be so nice to have this done "right", once and for all.
On Sat, Apr 1, 2017 at 2:42 PM, Fleshgrinder
On 4/1/2017 2:01 PM, Anatol Belski wrote:
> 1. optionally - yes, otherwise it should do platform default
> 2. no, this kind of operation is a pure parsing, no I/O related checks needed
> 3. irrelevant, but can be defined
>
> Other points yet I'd care about
> - result should be correct for target p
Hi,
> -Original Message-
> From: Rasmus Schultz [mailto:ras...@mindplay.dk]
> Sent: Saturday, April 1, 2017 11:13 AM
> To: Pierre Joye
> Cc: Kris Craig ; Sara Golemon ; PHP
> internals
> Subject: Re: [PHP-DEV] Directory separators on Windows
>
> > Also u
On 4/1/2017 1:03 PM, Anatol Belski wrote:
> " A Uniform Resource Identifier (URI) is a compact sequence of
> characters that identifies an abstract or physical resource" they
> say. Fits perfectly with PHP streams.
>
The problem I was referring to is not semantically. The problem is that
the cod
> -Original Message-
> From: Fleshgrinder [mailto:p...@fleshgrinder.com]
> Sent: Saturday, April 1, 2017 12:00 AM
> To: Anatol Belski ; internals@lists.php.net; Rasmus Schultz
>
> Subject: Re: [PHP-DEV] Directory separators on Windows
>
> On 3/31/2017 9:29
On 4/1/2017 11:13 AM, Rasmus Schultz wrote:
> So to summarize, a normalize_path() function should:
>
> 1. Fully normalize to an absolute path with no platform-specific separators
> 2. Have corrected case (for files/dirs that do exist.)
> 3. Have normalized (upper-case) drive-letter on Windows
>
>
> Also ucfirst is useless (or any case operations)
It's not useless, if you want a normalized path on Windows, it has to
include a drive-letter, and Windows FS isn't case-sensitive.
> Right now realpath will fail if the path does not exist
I know, that's one reason I don't use it.
It kind of so
On 3/31/2017 9:29 PM, Anatol Belski wrote:
> I can only link to this 😉
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=ec78507bd46a05f77dbde3fa4091ab4c91e61cad
>
> the new implementation was consistent but had to be reverted in 7.1
> partially, because of BC, even the use is inappropriate. W
> -Original Message-
> From: Fleshgrinder [mailto:p...@fleshgrinder.com]
> Sent: Friday, March 31, 2017 8:32 PM
> To: Anatol Belski ; internals@lists.php.net; Rasmus Schultz
>
> Subject: Re: [PHP-DEV] Directory separators on Windows
>
>
> $ php71 -a
Hey :)
On 3/31/2017 7:51 PM, Anatol Belski wrote:
> Well, there was slightly more in your msg, thus the response 😊
>
Not really:
On 3/30/2017 8:05 PM, Fleshgrinder wrote:
> Windows and paths is a complicated and lengthy story.
>
> TL;DR all versions of Windows are able to deal with slashes, an
> -Original Message-
> From: Fleshgrinder [mailto:p...@fleshgrinder.com]
> Sent: Friday, March 31, 2017 6:29 PM
> To: Anatol Belski ; internals@lists.php.net; Rasmus Schultz
>
> Subject: Re: [PHP-DEV] Directory separators on Windows
>
> On 3/31/2017 12:33
On 3/31/2017 12:33 PM, Anatol Belski wrote:
> Regarding the path variants support - it's not quite that way. PHP
> streams abstract many things, for both simplicity and security. The
> current state has historically grown on these two factors. So far I
> can tell, the only what we don't support is
> +1
> Can be used, for convert NAMESPACE to filepath in autoload )
>
>
> function __autoload($path)
> {
> include convert_seperators($path);
> }
>
>
> On Windows, it is what realpath does.
>
No, realpath() - is not used `include_path`
--
PHP Internals - PHP Runtime Development Mailing List
Hi,
> -Original Message-
> From: Fleshgrinder [mailto:p...@fleshgrinder.com]
> Sent: Thursday, March 30, 2017 8:05 PM
> To: Rasmus Schultz ; PHP internals
>
> Subject: Re: [PHP-DEV] Directory separators on Windows
>
> On 3/30/2017 3:25 PM, Rasmus Sch
On Fri, Mar 31, 2017 at 3:32 PM, Rasmus Schultz wrote:
> Well, this is the opposite of what I'm asking for, and does not address the
> case where paths have been persisted in a file or database and the data
> gets accessed from different OS.
>
> I understand the reasons given for not changing this
Well, this is the opposite of what I'm asking for, and does not address the
case where paths have been persisted in a file or database and the data
gets accessed from different OS.
I understand the reasons given for not changing this behavior in PHP
itself, so maybe we could have a standard functi
On Mar 31, 2017 8:19 AM, "S.A.N" wrote:
> Another option would be to create a function that converts all slashes in
a
> given input string to whatever the directory seperator should be on that
> platform. This way, devs wouldn't have to deal with bulky aliases like
> DIRECTORY_SEPERATOR clutteri
> Another option would be to create a function that converts all slashes in a
> given input string to whatever the directory seperator should be on that
> platform. This way, devs wouldn't have to deal with bulky aliases like
> DIRECTORY_SEPERATOR cluttering up their code.
>
> For example:
>
>
>
On 3/30/2017 3:25 PM, Rasmus Schultz wrote:
> Thoughts?
>
Windows and paths is a complicated and lengthy story.
TL;DR all versions of Windows are able to deal with slashes, and we
could easily use slashes everywhere all the time.
# History
The story why Windows is using the backslash might be o
On Thu, Mar 30, 2017 at 8:21 AM, Sara Golemon wrote:
> My first thought is UNC paths. On windows a file server share is
> denoted by \\host\share . if you combine that with relative paths
> produced from PHP, you end up in the dubious situation of
> "\\host\share/path/to/file" <--- wat?
>
> Over
On Mar 30, 2017 8:21 AM, "Sara Golemon" wrote:
>
> My first thought is UNC paths. On windows a file server share is
> denoted by \\host\share . if you combine that with relative paths
> produced from PHP, you end up in the dubious situation of
> "\\host\share/path/to/file" <--- wat?
>
> Overall,
My first thought is UNC paths. On windows a file server share is
denoted by \\host\share . if you combine that with relative paths
produced from PHP, you end up in the dubious situation of
"\\host\share/path/to/file" <--- wat?
Overall, it smells of magic.
-Sara
On Thu, Mar 30, 2017 at 8:25 AM,
On Thu, Mar 30, 2017 at 8:05 AM, Rowan Collins
wrote:
> On 30 March 2017 14:25:02 BST, Rasmus Schultz wrote:
>
> >Returning backslashes on Windows seems rather unnecessary in the first
> >place, since forward slashes work just fine?
>
> This may be true when using the paths within PHP, but is it
On Mar 30, 2017 8:25 PM, "Rasmus Schultz" wrote:
Today, I ran into a very hard-to-debug problem, in which paths (to SQL
files, in a database migration script) were kept in a map, persisted to a
JSON file, and this file was moved from a Windows to a Linux file-system -
because the paths on the Lin
On 30 March 2017 14:25:02 BST, Rasmus Schultz wrote:
>Returning backslashes on Windows seems rather unnecessary in the first
>place, since forward slashes work just fine?
This may be true when using the paths within PHP, but is it true outside of it?
If your JSON file had been read in by a .net
29 matches
Mail list logo