|
Posted by duzhidian@gmail.com on 10/15/07 20:41
failed to open stream: No such file or directory
I have the programs like this structure:
a.php is locate at .
b.php is located at ./lib
c.php is located at ./lib/sublib
a.php uses a function at b.php while b.php using a function at c.php
In a.php, it says: include_once(./lib/b.php) as it uses one function
in b.php
a.php is not supposed to know that b.php is using c.php, so it should
not include c.php.
In b.php, it says: include_once(./sublib/c.php) since it uses a
function in c.php.
b.php is not supposed to know that a.php uses itself, so it should not
include lib as include_once(../lib/sublib/c.php), but it does not
work.
The problem is: "... failed to open stream: No such file or directory
of c.php. .."
If using include_once(../lib/sublib/c.php) in b.php, the compiler is
happy. But it violates the general principle of who include files
only considering itself at it own position, not considering others who
use it (also, it is not supposed to know it) as in C++.
Any hints how to obey the above principle?
Thanks.
D.
Navigation:
[Reply to this message]
|