You can't do that. Relative include paths are already specified in the
INI variable. Using $curdir as a base gives you things like
"/home/brianm/public_html//usr/local/lib/php/../inc/incfile.php".
Clearly incorrect.
I don't think it matters overall, but I wanted to point that out.
Yeah, I know. It was more for convenience.
/* Relative path open */
if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) {
It looks to me like the include_path isn't even being checked here.
Should the documentation explain that better?
do you mean that items in the include_path are skipped or that includes that start with . are not looked for using the include_path? I have tested some things here that show that including something relative to an absolute path in the include path does work.
Example here. My include_path:
.:/usr/local/lib/php:/www/codelib/include
structure:
/www
/www/codelib/include
/www/datalib/include
/www/virthost/docroot
I can include "../../datalib/include/pub_data.php" from docroot.
FWIW, I can see clearly why what John is doing is wrong and I would never do it. I just want the manual to be clear because i don't think it is. If I understood why PHP would not let him do what he is doing, I would change the manual myself.
Brian.