note 103224 added to function.set-include-path
| From: | francoisrvespa at osu1 dot php dot net | Date: | Fri, 01 Apr 2011 19:17:24 +0000 |
| Subject: | note 103224 added to function.set-include-path | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178419@lists.php.net to get a copy of this message | ||
include_path is not taking in consideration by very commonly used functions such as file_exists(),
the following hack can come handy to override that
<?php
function suchFile($file) // like file_exists() but takes in consideration include_path
{
if(!file_exists($file))
{
$paths=explode(PATH_SEPARATOR,get_include_path());
foreach($paths as $p)
if(file_exists(preg_replace('%/$%','',$p)."/$file"))
return true;
return false;
}
else
return true;
}
----
Server IP: 69.147.83.197
Probable Submitter: 77.228.212.216
----
Manual Page -- http://www.php.net/manual/en/function.set-include-path.php
Edit -- https://master.php.net/note/edit/103224
Del: integrated -- https://master.php.net/note/delete/103224/integrated
Del: useless -- https://master.php.net/note/delete/103224/useless
Del: bad code -- https://master.php.net/note/delete/103224/bad+code
Del: spam -- https://master.php.net/note/delete/103224/spam
Del: non-english -- https://master.php.net/note/delete/103224/non-english
Del: in docs -- https://master.php.net/note/delete/103224/in+docs
Del: other reasons-- https://master.php.net/note/delete/103224
Reject -- https://master.php.net/note/reject/103224
Search -- https://master.php.net/manage/user-notes.php