On Fri, 16 Mar 2012 16:52:39 +0100, Eric Stenson <erics...@microsoft.com>
wrote:
Thank you, Gustavo! Is Dmitry on the internals mailing list?
It's best you send him an e-mail to dmi...@zend.com
I was talking with Pierre yesterday, and there was some question about
whether there was some distinction between streams that were created as
a result of zend_compile_file versus just those files that were called
by calling
zend_stream_open_function.
What would this distinction be and what would be the implication?
Conceptually, comparing zend_compile_file and zend_stream_function is
already a little fuzzy because they don't do the same thing;
zend_compile_file has already been provided a zend_file_handle. What may
make them comparable is that the zend_file_handle may be just a file name
and so effectively the file will have to be opened by the
zend_compile_file implementation (see also zend_stream_fixup).
Does the phar extension make any distinction between when streams are
opened? Or, is it by virtue of only handling files that only end with
extensions that aren't compiled that it's skipping the code in
php_cgi!main()?
I think the reason phar causes no problem is because CGI will not be
opening phar:// files as a first script, which is all php_cgi!main() deals
with. So phar's zend_stream_function will in this case end up falling back
on the default implementation and cause no problem.
In any case, it's true that default implementation of
zend_stream_open_function (php_stream_open_for_zend_ex) does store a
php_stream* in handle. However, this clearly isn't the general case (even
it were, breaking the abstraction would already be dubious). This is
definitely a bug.
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php