Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-30 Thread Dmitry Stogov
Hi Greg, I just don't see if my changes broke something. So could you please prove that committed patch has an issue (with test case), and restore part of your patch that was going to fix the issue. Sorry for double work. Thanks. Dmitry. Greg Beaver wrote: Dmitry Stogov wrote: Hi Marcus,

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-29 Thread Greg Beaver
Dmitry Stogov wrote: Hi Marcus, Sorry, if I broke something in latest patch, I just didn't see any comments from others about it. And from my point of view the patch did unnecessary things. I still think the same, becaus I mainly changed code that checks for wrapper in given argument, but not in

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-28 Thread Marcus Boerger
Hello Pierre, that sounds like a good idea. Let's provide a generic solution for this. marcus Friday, March 28, 2008, 11:03:46 AM, you wrote: > Hi, > On Tue, Mar 25, 2008 at 8:01 PM, Gregory Beaver <[EMAIL PROTECTED]> wrote: >> Stanislav Malyshev wrote: >> >> stream wrapper. Here is an exa

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-28 Thread Pierre Joye
Hi, On Tue, Mar 25, 2008 at 8:01 PM, Gregory Beaver <[EMAIL PROTECTED]> wrote: > Stanislav Malyshev wrote: > >> stream wrapper. Here is an example: > >> > >> oops.broken://UNC/path > > > > I wonder if .://UNC/path is treated as "."+//UNC/path (and the same > > for ..). It should anyway :) H

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-28 Thread Dmitry Stogov
Hi Marcus, Sorry, if I broke something in latest patch, I just didn't see any comments from others about it. And from my point of view the patch did unnecessary things. I still think the same, becaus I mainly changed code that checks for wrapper in given argument, but not in include_path. BTW: I

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-27 Thread Marcus Boerger
Hello Dmitry, Thursday, March 27, 2008, 11:33:55 AM, you wrote: > Hi Greg, > in php_resolve_path() > - you removed (p - filename > 1) check but it means that c://tmp will be > used as stream wrapper Basically he doesn't need to. The code with your modifiactions is wrong now. He changed it t

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-27 Thread Dmitry Stogov
Hi Greg, in php_resolve_path() - you removed (p - filename > 1) check but it means that c://tmp will be used as stream wrapper - you added check for !wrapper, but we don't need to do any filesystem search for filename with wrong wrapper I've removed this modifications. I also added proper

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-26 Thread Gregory Beaver
Marcus Boerger wrote: > Hello Gregory, > > + for (p = ptr; isalnum((int)*p) || *p == '+' || *p == '-' || > *p == '.'; p++); > + /* p - ptr > 1 allows us to skip things like "C:\whatever" */ > + if ((*p == ':') && (p - ptr > 1) && (path_len - (p - path) >

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-26 Thread Marcus Boerger
Hello Gregory, + for (p = ptr; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++); + /* p - ptr > 1 allows us to skip things like "C:\whatever" */ + if ((*p == ':') && (p - ptr > 1) && (path_len - (p - path) > 2) && (p[1] == '/') && (p[2] == '

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Gregory Beaver
Marcus Boerger wrote: > Hello Gregory, > > Tuesday, March 25, 2008, 8:01:56 PM, you wrote: > >> Stanislav Malyshev wrote: stream wrapper. Here is an example: oops.broken://UNC/path >>> I wonder if .://UNC/path is treated as "."+//UNC/path (and the same >>> for ..). It should anywa

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Marcus Boerger
Hello Gregory, Tuesday, March 25, 2008, 8:01:56 PM, you wrote: > Stanislav Malyshev wrote: >>> stream wrapper. Here is an example: >>> >>> oops.broken://UNC/path >> >> I wonder if .://UNC/path is treated as "."+//UNC/path (and the same >> for ..). It should anyway :) However I'm not too worried

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Gregory Beaver
Stanislav Malyshev wrote: >> stream wrapper. Here is an example: >> >> oops.broken://UNC/path > > I wonder if .://UNC/path is treated as "."+//UNC/path (and the same > for ..). It should anyway :) However I'm not too worried without > pathes like foo.bar - not likely to have path without any slash

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Stanislav Malyshev
stream wrapper. Here is an example: oops.broken://UNC/path I wonder if .://UNC/path is treated as "."+//UNC/path (and the same for ..). It should anyway :) However I'm not too worried without pathes like foo.bar - not likely to have path without any slashes unless it's . or .., and if you d

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Greg Beaver
Dmitry Stogov wrote: :( Any ideas how to support this? Dmitry. Stefan Walk wrote: On Monday 24 March 2008 20:28:49 Stanislav Malyshev wrote: Beats me, I'm sure posix-based systems don't, but it is called "Uniform Naming Convention" so it's possible somebody might implement it The fact that i

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Dmitry Stogov
:( Any ideas how to support this? Dmitry. Stefan Walk wrote: On Monday 24 March 2008 20:28:49 Stanislav Malyshev wrote: Beats me, I'm sure posix-based systems don't, but it is called "Uniform Naming Convention" so it's possible somebody might implement it The fact that it's called "uniform" d

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Stefan Walk
On Monday 24 March 2008 20:28:49 Stanislav Malyshev wrote: > > Beats me, I'm sure posix-based systems don't, but it is called "Uniform > > Naming Convention" so it's possible somebody might implement it > > The fact that it's called "uniform" doesn't mean it works in anything > but Windows :) In UN

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Dmitry Stogov
I'm going to commit it tomorrow. Thanks. Dmitry. Gregory Beaver wrote: Dmitry Stogov wrote: I hope it's the last iteration, but check me anyway. The patch is based on latest Gregory's patch. - optimized out strncpy() calls - zend_resolve_path() replaced with php_resolve_path() - improved php_

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Gregory Beaver
Dmitry Stogov wrote: > I hope it's the last iteration, but check me anyway. > The patch is based on latest Gregory's patch. > > - optimized out strncpy() calls > - zend_resolve_path() replaced with php_resolve_path() > - improved php_resolve_path() to resolve "file://..." > - fixed possible double-

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-25 Thread Dmitry Stogov
I hope it's the last iteration, but check me anyway. The patch is based on latest Gregory's patch. - optimized out strncpy() calls - zend_resolve_path() replaced with php_resolve_path() - improved php_resolve_path() to resolve "file://..." - fixed possible double-free issue in _php_stream_open_wr

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Greg Beaver
Andi Gutmans wrote: Can we please use strlcpy() instead of strncpy()? This is a coding standard we implemented years ago. obviously an easy change. FYI - this also needs to be fixed in fopen_with_path_rel in PHP_5_2, as I copied most of the code from that function. Greg -- PHP Internals -

RE: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Andi Gutmans
; Stas Malyshev > Subject: Re: [PHP-DEV] REMINDER - stream wrappers in include_path > > Hi Greg, > > I've fixed your patch to work with all functions (fopen, > file_get_contente). > Please verify it with ext/phar and then I'll commit it. > > Thanks. Dmitry. &g

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Stanislav Malyshev
Beats me, I'm sure posix-based systems don't, but it is called "Uniform Naming Convention" so it's possible somebody might implement it The fact that it's called "uniform" doesn't mean it works in anything but Windows :) In UNIX IIRC if one needs to access SMB volume the regular smb:// URLs ar

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Gregory Beaver
Stanislav Malyshev wrote: >> this would unfortunately break UNC paths on unix, which start with //. > > Unix has UNC paths? Beats me, I'm sure posix-based systems don't, but it is called "Uniform Naming Convention" so it's possible somebody might implement it (http://en.wikipedia.org/wiki/Path_(

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Stanislav Malyshev
this would unfortunately break UNC paths on unix, which start with //. Unix has UNC paths? -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Gregory Beaver
Dmitry Stogov wrote: > > > Gregory Beaver wrote: >> Dmitry Stogov wrote: >>> REALPATH_FAILED looks like a hack :( >>> PHP itself doesn't need it at all, according to your patch >>> php_stream_open() may just return NULL immediately instead of setting >>> of this flag. >>> However I am not sure that

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Dmitry Stogov
Gregory Beaver wrote: Dmitry Stogov wrote: REALPATH_FAILED looks like a hack :( PHP itself doesn't need it at all, according to your patch php_stream_open() may just return NULL immediately instead of setting of this flag. However I am not sure that it will work for all cases. The fact that we

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Gregory Beaver
Dmitry Stogov wrote: > REALPATH_FAILED looks like a hack :( > PHP itself doesn't need it at all, according to your patch > php_stream_open() may just return NULL immediately instead of setting > of this flag. > However I am not sure that it will work for all cases. The fact that > we cannot resolve

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Dmitry Stogov
REALPATH_FAILED looks like a hack :( PHP itself doesn't need it at all, according to your patch php_stream_open() may just return NULL immediately instead of setting of this flag. However I am not sure that it will work for all cases. The fact that we cannot resolve the path doesn't mean that w

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Dmitry Stogov
The direct comparison must be faster than memcmp(). memcmp() might be optimized into the same code but probably won't be. Thanks. Dmitry. Marcus Boerger wrote: Hello Gregory, Monday, March 24, 2008, 2:47:25 PM, you wrote: Marcus Boerger wrote: Hello Gregory, Monday, March 24, 2008, 2:28:00

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Marcus Boerger
Hello Gregory, Monday, March 24, 2008, 2:47:25 PM, you wrote: > Marcus Boerger wrote: >> Hello Gregory, >> >> Monday, March 24, 2008, 2:28:00 PM, you wrote: >> >> >>> Index: main/fopen_wrappers.c >>> === >>> RCS file: /repository/

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Gregory Beaver
Marcus Boerger wrote: > Hello Gregory, > > Monday, March 24, 2008, 2:28:00 PM, you wrote: > > >> Index: main/fopen_wrappers.c >> === >> RCS file: /repository/php-src/main/fopen_wrappers.c,v >> retrieving revision 1.175.2.3.2.13.2.9

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Marcus Boerger
Hello Gregory, Monday, March 24, 2008, 2:28:00 PM, you wrote: > Index: main/fopen_wrappers.c > === > RCS file: /repository/php-src/main/fopen_wrappers.c,v > retrieving revision 1.175.2.3.2.13.2.9 > diff -u -r1.175.2.3.2.13.2.9 fopen_

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Gregory Beaver
Dmitry Stogov wrote: > Hi Greg, > > In your second patch you forgot "break", so it couldn't work. > I don't see any reason in second patch at all, because you call > php_resolve_patch() from _php_stream_open_wrapper_ex() anyway. > > The bad thing with the first part that it calls realpath() functio

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-24 Thread Dmitry Stogov
Hi Greg, In your second patch you forgot "break", so it couldn't work. I don't see any reason in second patch at all, because you call php_resolve_patch() from _php_stream_open_wrapper_ex() anyway. The bad thing with the first part that it calls realpath() function twice for each include("rel

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-21 Thread Dmitry Stogov
Gregory Beaver wrote: Dmitry Stogov wrote: Hi Greg, I've fixed your patch to work with all functions (fopen, file_get_contente). Please verify it with ext/phar and then I'll commit it. Thanks. Dmitry. Gregory Beaver wrote: Hi, Please look at the stream wrappers in include_path patch I pos

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-21 Thread Gregory Beaver
Dmitry Stogov wrote: > Hi Greg, > > I've fixed your patch to work with all functions (fopen, > file_get_contente). > Please verify it with ext/phar and then I'll commit it. > > Thanks. Dmitry. > > Gregory Beaver wrote: >> Hi, >> >> Please look at the stream wrappers in include_path patch I posted >

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-21 Thread Dmitry Stogov
Hi Greg, I've fixed your patch to work with all functions (fopen, file_get_contente). Please verify it with ext/phar and then I'll commit it. Thanks. Dmitry. Gregory Beaver wrote: Hi, Please look at the stream wrappers in include_path patch I posted last week. Thanks, Greg Index: main/fopen

Re: [PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-20 Thread Steph Fox
Hi Greg, Please look at the stream wrappers in include_path patch I posted last week. I went to try this, but the patch doesn't apply to 5_3 any more since the re2c change. Could you post an updated version please? Thanks, - Steph -- PHP Internals - PHP Runtime Development Mailing List T

[PHP-DEV] REMINDER - stream wrappers in include_path

2008-03-20 Thread Gregory Beaver
Hi, Please look at the stream wrappers in include_path patch I posted last week. Thanks, Greg -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php