source: pro-violet-viettel/sourcecode/application/third_party/Smarty/sysplugins/smarty_internal_get_include_path.php

Last change on this file was 345, checked in by quyenla, 11 years ago

collaborator page

File size: 874 bytes
Line 
1<?php
2/**
3 * Smarty read include path plugin
4 *
5 * @package Smarty
6 * @subpackage PluginsInternal
7 * @author Monte Ohrt
8 */
9
10/**
11 * Smarty Internal Read Include Path Class
12 *
13 * @package Smarty
14 * @subpackage PluginsInternal
15 */
16class Smarty_Internal_Get_Include_Path {
17
18    /**
19     * Return full file path from PHP include_path
20     *
21     * @param string $filepath filepath
22     * @return string|boolean full filepath or false
23     */
24    public static function getIncludePath($filepath)
25    {
26        static $_include_path = null;
27
28        if ($_path_array === null) {
29            $_include_path = explode(PATH_SEPARATOR, get_include_path());
30        }
31
32        foreach ($_include_path as $_path) {
33            if (file_exists($_path . DS . $filepath)) {
34                return $_path . DS . $filepath;
35            }
36        }
37       
38        return false;
39    }
40
41}
42
43?>
Note: See TracBrowser for help on using the repository browser.