开发者

Question about the PHP include statement

开发者 https://www.devze.com 2022-12-13 20:01 出处:网络
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 tha

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消