#39542 [Com]: Search order for include_once/require_once wrong in get_include_path
| From: | snowy at coporatezoo dot com | Date: | Sat, 05 May 2007 14:35:03 +0000 |
| Subject: | #39542 [Com]: Search order for include_once/require_once wrong in get_include_path | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-112289@lists.php.net to get a copy of this message | ||
ID: 39542
Comment by: snowy at coporatezoo dot com
Reported By: snowy at corporatezoo dot com
Status: No Feedback
Bug Type: Scripting Engine problem
Operating System: Windows XP
PHP Version: 5.2.0
New Comment:
Hi, just tried this with php 5.2.2 (win32) and it's still not behaving
as < 5.2.0
I still suspect it has to do with the "optimization" introduced for
require_once.
I actually believe the behaviour to be incorrect, in that (1) some sort
of namespace for the file is held in cache, albeit not case-sensitive,
and (2) in the wrong search order (.= current directory seems to always
be searched first, no matter what set_include_path stipulates)
I just find it strange that no once else comes across this problem?
Previous Comments:
------------------------------------------------------------------------
[2007-05-04 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2007-04-26 09:34:23] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2007-04-18 05:37:03] rvp at journal dot com dot ph
PHP's default setting for open tags is ===> "short_open_tag = Off"
Set it to "On" or modify your script opening tags to long ones eg.
<?php {...} ?>
Regards to all.
------------------------------------------------------------------------
[2007-03-15 07:13:58] snowy at coporatezoo dot com
Hi, so I caught this while reading the change log for 5.2.0:
"Optimized require_once() and include_once() by eliminating fopen(3) on
second usage. (Dmitry)"
Perhaps this might be the issue, it might be optimized, but I'm not
sure if it's entirely correct.
------------------------------------------------------------------------
[2007-03-12 07:28:07] snowy at coporatezoo dot com
tried this on 5.2.1 on OSX as well and it also fails.
Another thing:
if my file is in /project/docroot/file.php
even if I do a:
require_once('/project/classes/File.php');
it still fails.
Notice that it's (1) case insensitive, (2) the actual full path is
given in require_once.
I thought it may have been caching the full path, but looks like it's
only looking if '[F|f]ile.php' (the file name) has been loaded.
Ie, even
set_include_path('/project');
require_once('classes/file.php'); // give a path name to avoid
namespace clash
doesn't work.
Is this going to be fixed? Or should we go and change all our
include_once/require_once if we want to upgrade to > 5.1.6?
thx
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/39542
--
Edit this bug report at http://bugs.php.net/?id=39542&edit=1