Bug #52845 [Com]: Documentation wrong re includes with relative paths
| From: | mail_ben_schmidt at yahoo dot com dot au | Date: | Wed, 15 Sep 2010 01:17:04 +0000 |
| Subject: | Bug #52845 [Com]: Documentation wrong re includes with relative paths | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5033@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52845&edit=1
ID: 52845
Comment by: mail_ben_schmidt at yahoo dot com dot au
Reported by: mail_ben_schmidt at yahoo dot com dot au
Summary: Documentation wrong re includes with relative paths
Status: Open
Type: Bug
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
New Comment:
Having now done a bit of testing, it seems the main problem is the term
'relative path'. What is actually meant is 'a path beginning with a
dot'. If the path is absolute, or begins with a dot, the include path is
not used. But relative paths such as 'subdir/file.php' still go through
the include_path mechanism.
Previous Comments:
------------------------------------------------------------------------
[2010-09-15 02:09:27] mail_ben_schmidt at yahoo dot com dot au
Description:
------------
The documentation about how relative includes work must be wrong. It
states that the include path is not checked when any kind of path
(relative or absolute) is given.
Note also the deficiency noted in bug #51569, also related to poor
documentation of how the include path/include statement works.
Test script:
---------------
include('PHPUnit/Framework.php');
Expected result:
----------------
According to the documentation, I expect a warning about non-existent
file PHPUnit/Framework.php, as this doesn't exist relative to the cwd or
the directory of the script, but somewhere inside PEAR's repository
(referenced in the include path).
Actual result:
--------------
The file is successfully found and included.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52845&edit=1