Files
smarty/libs/sysplugins/smarty_internal_get_include_path.php

43 lines
916 B
PHP
Raw Normal View History

<?php
/**
* Smarty read include path plugin
2011-09-16 14:19:56 +00:00
*
* @package Smarty
* @subpackage PluginsInternal
2011-09-16 14:19:56 +00:00
* @author Monte Ohrt
*/
/**
* Smarty Internal Read Include Path Class
2011-09-16 14:19:56 +00:00
*
* @package Smarty
* @subpackage PluginsInternal
*/
class Smarty_Internal_Get_Include_Path {
2011-09-16 14:19:56 +00:00
/**
* Return full file path from PHP include_path
2011-09-16 14:19:56 +00:00
*
* @param string $filepath filepath
2011-09-16 14:19:56 +00:00
* @return string|boolean full filepath or false
*/
public static function getIncludePath($filepath)
{
2011-09-16 14:19:56 +00:00
static $_include_path = null;
2011-09-16 14:19:56 +00:00
if ($_path_array === null) {
$_include_path = explode(PATH_SEPARATOR, get_include_path());
}
2011-09-16 14:19:56 +00:00
foreach ($_include_path as $_path) {
if (file_exists($_path . DS . $filepath)) {
return $_path . DS . $filepath;
}
}
2011-09-16 14:19:56 +00:00
return false;
}
2011-09-16 14:19:56 +00:00
}
?>