ID: 30881
Updated by: [EMAIL PROTECTED]
Reported By: ovdspek at liacs dot nl
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Debian Linux Sarge
PHP Version: 4.3.9
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2004-11-26 15:40:46] [EMAIL PROTECTED]
"If filename begins with <literal>../</literal>, it is looked only in
include_path relative to the current working directory."
------------------------------------------------------------------------
[2004-11-26 15:22:50] [EMAIL PROTECTED]
You are right, documentation is not absolutely clear. Documented
behavior is valid only if you don't go to upper directory in include.
b/2.php: <?php include "c/3.php"; ?>
b/c/3.php: b/c/3
`php b/2.php` works as documented - prints b/c/3 (if c/3.php doesn't
exist).
I will update the docs.
------------------------------------------------------------------------
[2004-11-26 11:39:05] ovdspek at liacs dot nl
> Current working
directory can be something different than directory of a script.
I understand, but apparently your implementation doesn't.
Why else would "include('../1.php');" fail?
------------------------------------------------------------------------
[2004-11-26 11:29:43] [EMAIL PROTECTED]
"Files for including are first looked in include_path relative to the
current working directory and then in include_path relative to the
directory of current script." in include() page. Current working
directory can be something different than directory of a script.
------------------------------------------------------------------------
[2004-11-26 11:10:37] ovdspek at liacs dot nl
So exactly where is that documented?
At http://php.net/include/ I see no exceptions for CLI and at
http://php.net/manual/en/features.commandline.php I see no exceptions
for include.
It does say "It does not change the working directory to that of the
script. (-C and --no-chdir switches kept for compatibility)", but
that's not relevant, as the include docs say it searches the directory
of the current script, not the current working directory.
If your implementation relies on the current working directory being
the directory of the current script, then your implementation (of this
docs/specs) is wrong.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/30881
--
Edit this bug report at http://bugs.php.net/?id=30881&edit=1