Code

Readded smarty
[gosa.git] / gosa-core / include / smarty / sysplugins / smarty_internal_get_include_path.php
1 <?php\r
2 /**\r
3  * Smarty read include path plugin\r
4  *\r
5  * @package Smarty\r
6  * @subpackage PluginsInternal\r
7  * @author Monte Ohrt\r
8  */\r
9 \r
10 /**\r
11  * Smarty Internal Read Include Path Class\r
12  *\r
13  * @package Smarty\r
14  * @subpackage PluginsInternal\r
15  */\r
16 class Smarty_Internal_Get_Include_Path {\r
17 \r
18     /**\r
19      * Return full file path from PHP include_path\r
20      *\r
21      * @param string $filepath filepath\r
22      * @return string|boolean full filepath or false\r
23      */\r
24     public static function getIncludePath($filepath)\r
25     {\r
26         static $_include_path = null;\r
27 \r
28         if ($_path_array === null) {\r
29             $_include_path = explode(PATH_SEPARATOR, get_include_path());\r
30         }\r
31 \r
32         foreach ($_include_path as $_path) {\r
33             if (file_exists($_path . DS . $filepath)) {\r
34                 return $_path . DS . $filepath;\r
35             }\r
36         }\r
37         \r
38         return false;\r
39     }\r
40 \r
41 }\r
42 \r
43 ?>