Edit report at http://bugs.php.net/bug.php?id=52847&edit=1

 ID:                 52847
 User updated by:    mail_ben_schmidt at yahoo dot com dot au
 Reported by:        mail_ben_schmidt at yahoo dot com dot au
 Summary:            Files to include are always searched for in current
                     directory
 Status:             Duplicate
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Mac OS X 10.6.2
 PHP Version:        5.3.2
 Block user comment: N

 New Comment:

Please read this bug report more carefully. The included file is *not*
in "the directory the currently executing file lives in" which is what
#51569 addresses, and is the intended fallback behaviour. It is merely
in the current working directory. (For many SAPIs this is the same
initially, but not for the CLI, for instance, and not when a script has
been included from another script running in a different directory.) The
documentation suggests the current working directory will only be
searched if "." is in include_path. This is false. The current directory
is being searched anyway. I don't know if this is a behaviour or
documentation problem. (The directory where the current script lives is
being searched, too, but that is the subject of #51569, and undeniably a
documentation problem.)


Previous Comments:
------------------------------------------------------------------------
[2010-09-15 08:43:26] ahar...@php.net

This is intended behaviour: php_resolve_path() includes a fallback case
at the end to search the directory the currently executing file lives in
if all else fails.



I'll update the documentation. Duping to doc bug #51569.

------------------------------------------------------------------------
[2010-09-15 03:32:15] mail_ben_schmidt at yahoo dot com dot au

Actually, this may be a behaviour problem, not a documentation problem.

------------------------------------------------------------------------
[2010-09-15 03:26:04] mail_ben_schmidt at yahoo dot com dot au

Description:
------------
The documentation at include and include_path suggests that the current
directory will not be searched if a '.' is not in include path. Even
though I can see no reason (e.g. in the source code referred to by bug
#51569) that the current directory should be searched, it can be
demonstrated that it is.



See also bug #51569 and bug #52845 for further include_path
documentation deficiencies.



Test script:
---------------
1. Place in a file 'test/test.php':



set_include_path('/bin'); // won't find any php files here!

include('another.php');



2. touch another.php



3. php test/test.php



Expected result:
----------------
Warning that another.php cannot be found.



Actual result:
--------------
No warning.



N.B. In line with the undocumented feature mentioned in bug #51569, if
another.php is moved to test/another.php, it is still found also,
because it is in the directory of the running script.




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52847&edit=1

Reply via email to