summaryrefslogtreecommitdiff
path: root/lib/smarty/sysplugins/smarty_internal_get_include_path.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-10-11 14:01:29 +0200
committeremkael <emkael@tlen.pl>2016-10-11 14:01:29 +0200
commit51609351f2c4b5082b7e6f0744cd3811c325303f (patch)
tree739015e9ec69bc185ebe30db21369ae0b8b692ce /lib/smarty/sysplugins/smarty_internal_get_include_path.php
parent8d1b0dad63e3906efa9393ef01d08b77d83417b5 (diff)
* initial template
Diffstat (limited to 'lib/smarty/sysplugins/smarty_internal_get_include_path.php')
-rw-r--r--lib/smarty/sysplugins/smarty_internal_get_include_path.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/smarty/sysplugins/smarty_internal_get_include_path.php b/lib/smarty/sysplugins/smarty_internal_get_include_path.php
new file mode 100644
index 0000000..7a9739e
--- /dev/null
+++ b/lib/smarty/sysplugins/smarty_internal_get_include_path.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty read include path plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Monte Ohrt
+ */
+
+/**
+ * Smarty Internal Read Include Path Class
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ */
+class Smarty_Internal_Get_Include_Path {
+
+ /**
+ * Return full file path from PHP include_path
+ *
+ * @param string $filepath filepath
+ * @return string|boolean full filepath or false
+ */
+ public static function getIncludePath($filepath)
+ {
+ static $_include_path = null;
+
+ if ($_path_array === null) {
+ $_include_path = explode(PATH_SEPARATOR, get_include_path());
+ }
+
+ foreach ($_include_path as $_path) {
+ if (file_exists($_path . DS . $filepath)) {
+ return $_path . DS . $filepath;
+ }
+ }
+
+ return false;
+ }
+
+}
+
+?> \ No newline at end of file