From:             mills at sinetechnologies dot com
Operating system: Win XP
PHP version:      5.0.1
PHP Bug Type:     Directory function related
Bug description:  include does not traverse include_path subdirectories

Description:
------------
This is new for PHP5. PHP4 works as expected. 

Using require_once as the test, and having a properly set up include path,
require_once does not travel farther down the include_path to locate files
to include. 

Same behavior in cgi and module implementations. 

For example, take the following include path: 
include_path = ".;C:\Program Files\Apache Group\Apache\php\include"

In the include directory is another directory called 'phrame'

The phrame directory contains files and folders. The file 'include.php'
contains other include calls such as include( 'util/Object.php'); (the
location of which is "C:\Program Files\Apache
Group\Apache\php\include\phrame\util\Object.php") This should use . and
then find the util/Object.php. It does in PHP4, but not in PHP5. 

It looks like the parser is only going one directory deep when searching
for files, and not allowing recursive calls. For PHP4, it works as
expected, and all files are included, but PHP5 only goes one directory
deep, and fails for subdirectories. 

This makes implementing projects built with PHP4 and extending them with
PHP5 a nightmare for both server administrators and developers.

Directory Structure Summary:  

/include
    /phrame
        include.php
        /util
            /Object.php



Reproduce code:
---------------
//load include page which loads other needed pages
require_once 'phrame/include.php'; 

//directly load a needed page for test purposes. 
require_once 'phrame/util/Object.php';

Expected result:
----------------
//in PHP4
//include loaded and all other pages loaded
require_once 'phrame/include.php';
 
//a direct call to this page gets loaded. 
require_once 'phrame/util/Object.php';

Actual result:
--------------
//in PHP5
//partial works, include.php is included if blank,
//but because of other include calls, the require_once
//causes this page to fail to load.
require_once 'phrame/include.php'; 

//does not work! page fails to load 
require_once 'phrame/util/Object.php';

-- 
Edit bug report at http://bugs.php.net/?id=29698&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29698&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29698&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29698&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29698&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29698&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29698&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29698&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29698&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29698&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29698&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29698&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29698&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29698&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29698&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29698&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29698&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29698&r=float

Reply via email to