On 10.11.2009, at 19:49, Stanislav Malyshev wrote:

Hi!

In order to solve the above issues this RFC proposes the addition of a new construct/function for now called “autoload_include” for lack of a better name that largely behaves like the “include” does today with the following differences, that when the include failed because of a missing file no
warning is raised and php null is returned.

Maybe it'd be easier to just add parameter to file_exists that allows it to use include_path? I think that's at least what ZF is trying to do with that fopen - it tries to find out if such file exists in the path and if so - include it. I don't think you need to create special language construct for that - you can shut off warning with @.


yes that would solve the issue partially. the race condition would still remain, but its admitedly a rare case .. well I guess not so rare if you have a busy site and try to implement some caching for generated files .. then again these kinds of files are rarely loaded via autoload (probably more used for some generated arrays and stuff like that). it would also not solve the imho needless file system operations.

that being said, i brought up adding such a flag to file_exists() a few times before and each attempt has been shot down saying that fopen () should have never gotten this flag and this portion of the code should not mess with the include path.

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