php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37749 require does not function properly under certain conditions
Submitted: 2006-06-08 17:49 UTC Modified: 2006-06-08 17:52 UTC
From: eroberts at gowfb dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.4.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eroberts at gowfb dot com
New email:
PHP Version: OS:

 

 [2006-06-08 17:49 UTC] eroberts at gowfb dot com
Description:
------------
If you are in directory: rootdir/

and you require file: rootdir/dir/file1.php

and file1.php requires file2.php

if a file named file2.php does not exist in rootdir/, then file2 will be rootdir/dir/file2.php,

BUT, if a file named file2.php exists in rootdir/, then file2 will be rootdir/file2.php

Reproduce code:
---------------
#### base.php
require 'somedir/file1.php';

#### file1.php
require 'file2.php';



Expected result:
----------------
if ./file2.php exists, then file1.php will include ./file2.php

if ./file2.php does not exist and ./somedir/file2.php exists, then file1.php will include ./somedir/file2.php


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-08 17:52 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Use absolute path if you don't want require() to use include_path.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 15:01:34 2024 UTC