php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74191 file_exists needs option to use include path
Submitted: 2017-03-01 15:51 UTC Modified: 2020-12-09 17:46 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: dpfender44 at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: *General Issues
PHP Version: 7.1.2 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dpfender44 at gmail dot com
New email:
PHP Version: OS:

 

 [2017-03-01 15:51 UTC] dpfender44 at gmail dot com
Description:
------------
It would be nice to have an option for file_exists() that would do a search using the include path.  This would allow a validity check for a file to be included with "include_once" or "require_once".  These functions use the include path to find a file.  Currently, I have programmed my own function called my_file_exists() to be used instead of file_exists() so the test is done on all directories in the include path.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-08 05:07 UTC] pollita@php.net
? This wouldn't actually be terribly difficult, but I have to ask: Given that it's fairly trivial to do in userspace, what's the problem with doing it there?
 [2017-07-31 21:22 UTC] gmblar+php at gmail dot com
try https://secure.php.net/manual/en/function.stream-resolve-include-path.php
 [2020-12-09 17:46 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2020-12-09 17:46 UTC] cmb@php.net
I can't see a single good reason for adding this functionality;
besides that it can easily be implemented in userland, it still
doesn't prevent potential race conditions.  If you feel strongly
that it would be a useful addition, please forward the request to
the internals mailing list.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 10:01:33 2025 UTC