Req #38339 [Fbk->NoF]: Wanted: Find included file first in the script's path, than include_path option

From: Date: Sun, 29 Jan 2017 04:22:48 +0000
Subject: Req #38339 [Fbk->NoF]: Wanted: Find included file first in the script's path, than include_path option
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207022@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=38339&edit=1 ID: 38339 Updated by: php-bugs@lists.php.net Reported by: me at daybreaker dot info Summary: Wanted: Find included file first in the script's path, than include_path option -Status: Feedback +Status: No Feedback Type: Feature/Change Request Package: *General Issues Operating System: Linux Ubuntu 6.06 LTS (Server) PHP Version: 5.1.4 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2017-01-20 21:50:49] heiglandreas@php.net Is this still relevant? ------------------------------------------------------------------------ [2006-08-05 02:46:05] me at daybreaker dot info The feature that is included at PHP 4.0.7 by Adny still works well, but I want you to change the search order. If there exists foo/config2.php which prints "foo/config2.php" and add include("config2.php"); into foo/test.php, the expected result is: config.php foo/config.php foo/config2.php and the actual result is config.php config.php foo/config2.php So there's no bug in the original feature. I just want to change the search order. ------------------------------------------------------------------------ [2006-08-05 02:10:53] me at daybreaker dot info 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 this bug report at https://bugs.php.net/bug.php?id=38339&edit=1

« previous php.bugs (#207022) next »