$_path) { $_include_path[$key] = rtrim($_path, '/\\'); } $_has_stream_include = function_exists('stream_resolve_include_path'); } // try PHP include_path foreach ($dirs as $dir) { if ($dir[0] != '/' && $dir[1] != ':') { $_d_path = $dir . isset($file) ? $file : ''; if ($_has_stream_include) { // available since PHP 5.3.2 $path = stream_resolve_include_path($_d_path); if ($path !== false && is_file($path)) { return $smarty->_realpath($path); } } foreach ($_include_path as $_i_path) { if (is_file($_i_path . DS . $_d_path)) { return $smarty->_realpath($_i_path . DS . $_d_path); } } } } return false; } }