Question about the PHP include statement
I'm looking through the Zend_View source and I see this:
include 'zend.view://' . func_get_arg(0);
what does the string "zend.view://
" represent and how would the include statement resolve that in 开发者_运维技巧php?
It represents a custom stream wrapper, see here: http://www.php.net/manual/en/intro.stream.php.
Zend_View_Stream defines it and, looking at the docs, it simply makes sure that your view script continues to work even if short tags aren't enabled on your php instance.
What would happen is that PHP resolves that url scheme as being defined in a class (after you've registered it using stream_wrapper_register) and uses methods in there (stream_open, stream_read etc.) to actually open and read the contents of the file.
精彩评论