|
Posted by Tommy Gildseth on 02/24/06 22:07
Erwin Moller wrote:
>
> So you might expect that PHP is counting the number os time a certain file
> is required, but that is NOT what it says: It only look for THE SAME FILE.
>
> The difference might not seem big, but this is excactly what causes your
> problem: Your include is used in different files, and thus included every
> time, hence the multiple declaration.
No, PHP has more intelligence when it comes to require_once than that, and
will recognise that they are both the same file, even though they are being
included via 2 different files.
This even holds true if you chdir('somedir') and use a different path to
include the same file.
--
Tommy
http://design.twobarks.com/
[Back to original message]
|