Re: REMINDER - stream wrappers in include_path
| From: | Gregory Beaver | Date: | Fri, 21 Mar 2008 16:53:05 +0000 |
| Subject: | Re: REMINDER - stream wrappers in include_path | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36238@lists.php.net to get a copy of this message | ||
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
>> last week.
>>
>> Thanks,
>> Greg
>>
Hi Dmitry,
the patch has a few major problems and a few minor ones. First off,
there are spaces instead of tabs, which is not a huge deal, I've
corrected that in the attached patch.
It is, however, logically void to do stream wrapper operations in
plain_wrapper.c. I removed that code entirely. Instead, the path
resolve is now done in php_stream_open_wrapper_ex where it belongs,
before determining which stream wrapper to open. This will result in a
double call to the function when calling include, but because the 2nd
call will simply return after determining it has received a full path.
I've attached 2 patches (apparently, Zend is not included in cvs diff -u
of php5), 1 for adding path resolution to include/require (this is a
significant performance improvement over the existing code). The second
patch adds stream wrapper support to both php_resolve_path and
_php_stream_open_wrapper_ex, which automatically gives stream wrapper in
include_path support to all current and future functions that use
include_path.
Greg