note 46845 added to function.is-file
| From: | ludvig dot ericson at gmail dot com | Date: | Mon, 25 Oct 2004 18:06:47 +0000 |
| Subject: | note 46845 added to function.is-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-79080@lists.php.net to get a copy of this message | ||
I tend to use alot of includes, and I found that the is_file is based on the script executed, not
ran.
if you request /foo.php and foo.php looks like this:
<?php
include('foobar/bar.php');
?>
and bar.php looks like this:
<?php
echo (is_file('foo/bar.txt'));
?>
Then PHP (on win32, php 5.x) would look for /foo/bar.txt and not /foobar/foo/bar.txt.
you would have to rewrite the is_file statement for that, or change working directory.
Noting this since I sat with the problem for some time,
cheers, Toxik.
----
Manual Page -- http://www.php.net/manual/en/function.is-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46845
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46845&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46845&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46845&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46845&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46845&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46845&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46845&report=yes
Search -- http://master.php.net/manage/user-notes.php