From: me at daybreaker dot info
Operating system: Linux Ubuntu 6.06 LTS (Server)
PHP version: 5.1.4
PHP Bug Type: Feature/Change Request
Bug description: Wanted: Find included file first in the script's path, than
include_path option
Description:
------------
I've found that PHP finds included files (specified by 'include',
'include_once', 'require', 'require_once' functions) first in
'include_path' option, earlier than the current script file's path.
I think it's more feasible that the first search should be done in the
current script file's path, rather than the current working directory
specified in 'include_path' option.
If there are some included files which have same name (and not same
pathes), PHP simply ignores the files who is included later in a context
(or reinclude the first file when 'once' is not specified), though there
may exist some cases that someone includes files which have same names,
but are in the same directory in which the current script file is.
Reproduce code:
---------------
(Without touching 'include_path' option, it contains
'.:/usr/share/php:/usr/share/pear' by default)
* test.php
include("config.php");
include("foo/test.php");
* config.php
echo "config.php<br>";
* foo/test.php
include("config.php");
* foo/config.php
echo "foo/config.php<br>";
Expected result:
----------------
config.php
foo/config.php
Actual result:
--------------
config.php
config.php
--
Edit bug report at http://bugs.php.net/?id=38339&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38339&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38339&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38339&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38339&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38339&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38339&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38339&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38339&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38339&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38339&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38339&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38339&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38339&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38339&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38339&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38339&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38339&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38339&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38339&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38339&r=mysqlcfg