4 * Smarty read include path plugin
7 * @subpackage PluginsInternal
12 * Smarty Internal Read Include Path Class
14 class Smarty_Internal_Get_Include_Path {
16 * Return full file path from PHP include_path
18 * @param string $filepath filepath
19 * @return mixed full filepath or false
21 public static function getIncludePath($filepath)
23 static $_path_array = null;
25 if(!isset($_path_array)) {
26 $_ini_include_path = ini_get('include_path');
28 if(strstr($_ini_include_path,';')) {
30 $_path_array = explode(';',$_ini_include_path);
32 $_path_array = explode(':',$_ini_include_path);
35 foreach ($_path_array as $_include_path) {
36 if (file_exists($_include_path . DS . $filepath)) {
37 return $_include_path . DS . $filepath;