On 11.11.2009, at 14:50, Greg Beaver wrote:

> stream_resolve_include_path() as currently constructed could not be
> intercepted, and is actually unable to process an include_path that
> contains streams.  I'm guessing it was written long before PHP 5.3. 
> This could be easily fixed by having stream_resolve_include_path call
> zend_resolve_path() instead of doing its own internal calculations. 
> With these changes, an opcode cache could easily cache the results.

ok. sounds like something that should be done.

> As for your naming concerns, if we were to add an alias called
> is_includable() to stream_resolve_include_path(), that would be much
> clearer:
> 
> if (is_includable($file)) {
>    include $file;
> }
> 
> The assumption here is that we are simply testing whether the file
> exists and whether php can actually read the file, not whether the file
> has syntax errors.  A file with syntax errors is an exceptional
> situation, and should be handled by a clear fatal error, imo.


Well for all I care it could remain with stream_resolve_include_path(), though 
I am not sure if we really need that "stream" namespace, then again its a 
function that will not be used a lot in daily coding, so I do not care either 
way.

I have updated the current RFC accordingly:
http://wiki.php.net/rfc/autoload_include

So there are three approaches listed in the RFC:
1) http://wiki.php.net/rfc/autoload_include#proposal
add a new alternative to include, which works the same except that for missing 
files it returns null and on success it returns the file location (unless the 
file already returns something else explicitly)

2) http://wiki.php.net/rfc/autoload_include#add_stream_support_to_includerequire
add stream support to include/require

3) 
http://wiki.php.net/rfc/autoload_include#add_function_to_resolve_the_include_path
fix up stream_resolve_include_path() to support streams.

I would like to call for a vote on the above. For 1) and 3) I invite everybody 
to optionally also submit a proposal for a name. Finally optionally include in 
your vote if would like to see this feature added to 5.3.2 or if it should wait 
for the next minor/major version update instead.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to