php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52845 Documentation wrong re includes with relative paths
Submitted: 2010-09-15 02:09 UTC Modified: 2010-09-15 05:55 UTC
From: mail_ben_schmidt at yahoo dot com dot au Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2010-09-15 02:09 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-15 03:17 UTC] mail_ben_schmidt at yahoo dot com dot au
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.
 [2010-09-15 05:49 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-09-15 05:49 UTC] aharvey@php.net
-Type: Bug +Type: Documentation Problem
 [2010-09-15 05:55 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=303377
Log: Fix doc bug #52845 (Documentation wrong re includes with relative paths) by
adding clarifying text on what we actually mean by full and relative paths.
 [2010-09-15 05:55 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2010-09-15 05:55 UTC] aharvey@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 00:01:30 2024 UTC