<?php
if (!defined('DIR_SEP')) {
if (stripos(php_uname('s'), 'Win')===FALSE) // Mac OS/LINUX/UNIX directory separator
define('DIR_SEP', "/");
else // MS Windows directory separator
define('DIR_SEP', "\\"); }
function file_path_exists($fn) {
if (file_exists($fn)) return $fn;
$paths=explode(PATH_SEPARATOR, get_include_path());
foreach ($paths as &$p) {if (substr($p, strlen($p)-1)!==DIR_SEP) $p.=DIR_SEP;}
$i=0; $m=count($paths);
do {if (file_exists($paths[$i].$fn)) return $paths[$i].$fn;}
while (++$i<$m);
return FALSE; }
?>
|