note 103295 added to function.get-included-files
| From: | JonathonHibbard at osu1 dot php dot net | Date: | Wed, 06 Apr 2011 02:43:12 +0000 |
| Subject: | note 103295 added to function.get-included-files | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178541@lists.php.net to get a copy of this message | ||
Unsing sam at consideropen dot com's removal of path information, here is a simple search
method for checking a file name either by ignoring all paths, or by passing a full path file name...
<?php
public static function checkFileIsIncluded($chkFile, $ignorePath = true) {
if((bool)$ignorePath === true) {
return in_array($chkFile, preg_replace("/\/.*\//", "",
get_included_files()));
} else {
if(!is_file($chkFile)) {
throw new Exception("File Passed does not exist!");
}
return in_array($chkFile, get_included_files());
}
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 65.185.0.180
----
Manual Page -- http://www.php.net/manual/en/function.get-included-files.php
Edit -- https://master.php.net/note/edit/103295
Del: integrated -- https://master.php.net/note/delete/103295/integrated
Del: useless -- https://master.php.net/note/delete/103295/useless
Del: bad code -- https://master.php.net/note/delete/103295/bad+code
Del: spam -- https://master.php.net/note/delete/103295/spam
Del: non-english -- https://master.php.net/note/delete/103295/non-english
Del: in docs -- https://master.php.net/note/delete/103295/in+docs
Del: other reasons-- https://master.php.net/note/delete/103295
Reject -- https://master.php.net/note/reject/103295
Search -- https://master.php.net/manage/user-notes.php