Re: Weird virtual() behavior for nested require()
| From: | Paul Cantrell | Date: | Wed, 17 Nov 2004 06:12:49 +0000 |
| Subject: | Re: Weird virtual() behavior for nested require() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202275@lists.php.net to get a copy of this message | ||
Well, after 36 hours of silence on this one, I'll consider the php-general list stumped, and file it as a bug.
P
On Nov 15, 2004, at 11:50 AM, Paul Cantrell wrote:
I'm getting a weird behavior when virtual() calls another page that uses a require(). The behavior seems contrary to the docs for virtual. Consider these four files:"Prediction is hard, especially of the future." -- Niels Bohr------ foo.php ------ This is foo. <?php virtual('subdir/bar.php'); ?>------ foo.shtml ------ This is foo. <!--#include virtual="subdir/bar.php"-->------ subdir/bar.php ------ This is bar. <?php require('./baz.php'); ?>------ subdir/baz.php ------ This is baz.According to the docs, virtual() handles the argument as an Apache subrequest -- in other words, it should be equivalent to an SSI include. But it's not. As I would expect, foo.shtml produces this:This is foo. This is bar. This is baz.Here's what I get from foo.php:This is foo. This is bar. Warning: main(./baz.php): failed to open stream: No such file or directory in /blah/blah/blah/subdir/bar.php on line 2Fatal error: main(): Failed opening required './baz.php' (include_path='.:/usr/local/lib/php') in /blah/blah/blah/subdir/bar.php on line 2Oddly, it works if bar.php says require('baz.php') instead of require('./baz.php'). That smells really bad. Is this a bug, or am I missing something? Cheers, Paul _________________________________________________________________ "After hearing ten thousand explanations, a fool is no wiser. But an intelligent person needs only two thousand five hundred."-- Mahabharata-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _________________________________________________________________