# file_exists() and include path

- Thread: https://externals.io/message/13497
- Original archive: https://news-web.php.net/php.internals/13497
- Started by Lukas Smith on 2004-10-25T08:49:23+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #13497 — Lukas Smith — 2004-10-25T08:49:23+00:00

URL: https://externals.io/message/13497#13497

Hi,

Afaik not having a flag to also check the include path has not been 
added, since that part of PHP is not supposed to be messing with ini 
settings. However that doesnt negate that something like this is very 
much in need for anyone developing applications that load code on 
demand. For example in PEAR:MDB[2] I load extended functionality 
ondemand. Some goes for PEAR::DB_DataObject. With the new __autoload() 
we are even engouraging this more (yes obviously its not going to help 
you alot if in autoload you discover that the file you want to include 
is missing, as you are going to have a fatal error eitherway. However 
that way you could point more clearily to the issue and also it may be 
that there are several locations where the source could be located). 
Obviously you can hack around this and essentially all of the above 
examples are likely to do just that (note that using `fopen()` to hack 
around this is not a good idea, but this shows that having a flag for 
the include path is not that far fetched).

regards,
Lukas

---

## #13565 — Sara Golemon — 2004-10-27T15:58:17+00:00

URL: https://externals.io/message/13497#13565 · In reply to: #13497

> Afaik not having a flag to also check the include path has not been added, 
> since that part of PHP is not supposed to be messing with ini settings.
>
Rather than mangle `file_exists()` with another option, how about something 
more task specific like an equivalent to `which`?

-Sara
