Re: REMINDER - stream wrappers in include_path

From: Date: Fri, 21 Mar 2008 17:16:51 +0000
Subject: Re: REMINDER - stream wrappers in include_path
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-36243@lists.php.net to get a copy of this message
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 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.
thanks.
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 is probably better, but then we should probably remove include_path from plain_file_wrapper at all.
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'll need to look into it more careful.
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.
I'm not sure about performance improvement. This patch might make performance degradation especially for PHP with opcode caches. I'll need to look into the patches and benchmark them. Sorry, but I'll able to do it only on next week. May be you'll get some ideas and improve the patch before I'll start. Thanks. Dmitry.
Greg


« previous php.internals (#36243) next »