Re: [PHP-DEV] file_exists and array_merge_clobber

2003-10-01 Thread Hartmut Holzgraefe
Greg Beaver wrote: In keeping with other functions that test pseudo-types like is_callable(), why not create a new function is_includeable() that will take a filename/path, and use include_path by default, or accept an optional array of paths to search. if (is_includeable("somefile.php")) {

Re: [PHP-DEV] file_exists and array_merge_clobber

2003-10-01 Thread Greg Beaver
In keeping with other functions that test pseudo-types like is_callable(), why not create a new function is_includeable() that will take a filename/path, and use include_path by default, or accept an optional array of paths to search. if (is_includeable("somefile.php")) { include "somefile

RE: [PHP-DEV] file_exists and array_merge_clobber

2003-10-01 Thread Lukas Smith
> From: Jon Parise [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 01, 2003 10:07 AM > On Wed, Oct 01, 2003 at 10:00:23AM +0200, Hartmut Holzgraefe wrote: > > > the whole point about this additional feature is that you can use it to > > check > > for include file existance before the actual

Re: [PHP-DEV] file_exists and array_merge_clobber

2003-10-01 Thread Jon Parise
On Wed, Oct 01, 2003 at 10:00:23AM +0200, Hartmut Holzgraefe wrote: > the whole point about this additional feature is that you can use it to > check > for include file existance before the actual include: > > if (file_exists("somefile.php", true)) { > include "somefile.php"; > } > > IMHO thi

Re: [PHP-DEV] file_exists and array_merge_clobber

2003-10-01 Thread Hartmut Holzgraefe
Justin Hannus wrote: I agree with Wez, what if you are searching for a file with a relative file path, e.g: would return true if "somefile.php" is not in the current directory but is in your include path, not what you expected. Besides, you can easily implement this functionality in php. its going

Re: [PHP-DEV] file_exists and array_merge_clobber

2003-09-30 Thread Justin Hannus
Aahh, I didn't see that in your original message :) "Lukas Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > From: Justin Hannus [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, September 30, 2003 8:12 PM > > > > I agree with Wez, what if you are searching for a file with a relat

RE: [PHP-DEV] file_exists and array_merge_clobber

2003-09-30 Thread Lukas Smith
> From: Justin Hannus [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 30, 2003 8:12 PM > > I agree with Wez, what if you are searching for a file with a relative > file > path, e.g: > > if (file_exists("somefile.php")) > // ... > > would return true if "somefile.php" is not in the current

Re: [PHP-DEV] file_exists and array_merge_clobber

2003-09-30 Thread Justin Hannus
I agree with Wez, what if you are searching for a file with a relative file path, e.g: wrote in message news:[EMAIL PROTECTED] > Using the include path for file_exists doesn't sound useful to me, for > similar reasons as those for not allowing to write a file in the include > path - which file ar

RE: [PHP-DEV] file_exists and array_merge_clobber

2003-09-30 Thread Lukas Smith
> From: Wez Furlong [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 30, 2003 12:58 PM > Using the include path for file_exists doesn't sound useful to me, for > similar reasons as those for not allowing to write a file in the include > path - which file are you actually writing to? What if

Re: [PHP-DEV] file_exists and array_merge_clobber

2003-09-30 Thread Wez Furlong
Using the include path for file_exists doesn't sound useful to me, for similar reasons as those for not allowing to write a file in the include path - which file are you actually writing to? What if someone puts a file with the same name earlier in the include path and so on. What is probably bet