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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
39 - 37 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC