3 * Smarty read include path plugin
6 * @subpackage PluginsInternal
11 * Smarty Internal Read Include Path Class
14 * @subpackage PluginsInternal
16 class Smarty_Internal_Get_Include_Path
19 * Return full file path from PHP include_path
21 * @param string $filepath filepath
23 * @return string|boolean full filepath or false
25 public static function getIncludePath($filepath)
27 static $_include_path = null;
29 if (function_exists('stream_resolve_include_path')) {
30 // available since PHP 5.3.2
31 return stream_resolve_include_path($filepath);
34 if ($_include_path === null) {
35 $_include_path = explode(PATH_SEPARATOR, get_include_path());
38 foreach ($_include_path as $_path) {
39 if (file_exists($_path . DS . $filepath)) {
40 return $_path . DS . $filepath;