From 9eb4b64890977e145d8e50877b9f7311c2626170 Mon Sep 17 00:00:00 2001 From: mohrt Date: Wed, 26 Jun 2002 16:08:29 +0000 Subject: [PATCH] update get_include_path, get _path_array only once --- Smarty.class.php | 17 ++++++++++------- demo/templates/header.tpl | 2 +- libs/Smarty.class.php | 17 ++++++++++------- templates/header.tpl | 2 +- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index c051ab4e..58a6f521 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -1919,15 +1919,18 @@ function _run_insert_handler($args) \*======================================================================*/ function _get_include_path($file_path,&$new_file_path) { - $_ini_include_path = ini_get('include_path'); + static $_path_array = null; - if(strstr($_ini_include_path,';')) { - // windows pathnames - $_path_array = explode(';',$_ini_include_path); - } else { - $_path_array = explode(':',$_ini_include_path); - } + if(!isset($_path_array)) { + $_ini_include_path = ini_get('include_path'); + if(strstr($_ini_include_path,';')) { + // windows pathnames + $_path_array = explode(';',$_ini_include_path); + } else { + $_path_array = explode(':',$_ini_include_path); + } + } foreach ($_path_array as $_include_path) { if (@file_exists($_include_path . DIR_SEP . $file_path)) { $new_file_path = $_include_path . DIR_SEP . $file_path; diff --git a/demo/templates/header.tpl b/demo/templates/header.tpl index e5b68395..eadb3817 100644 --- a/demo/templates/header.tpl +++ b/demo/templates/header.tpl @@ -1,6 +1,6 @@ -{popup_init} +{popup_init src="/javascripts/hiermenus.js"} {$title} - {$Name} diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index c051ab4e..58a6f521 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1919,15 +1919,18 @@ function _run_insert_handler($args) \*======================================================================*/ function _get_include_path($file_path,&$new_file_path) { - $_ini_include_path = ini_get('include_path'); + static $_path_array = null; - if(strstr($_ini_include_path,';')) { - // windows pathnames - $_path_array = explode(';',$_ini_include_path); - } else { - $_path_array = explode(':',$_ini_include_path); - } + if(!isset($_path_array)) { + $_ini_include_path = ini_get('include_path'); + if(strstr($_ini_include_path,';')) { + // windows pathnames + $_path_array = explode(';',$_ini_include_path); + } else { + $_path_array = explode(':',$_ini_include_path); + } + } foreach ($_path_array as $_include_path) { if (@file_exists($_include_path . DIR_SEP . $file_path)) { $new_file_path = $_include_path . DIR_SEP . $file_path; diff --git a/templates/header.tpl b/templates/header.tpl index e5b68395..eadb3817 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -1,6 +1,6 @@ -{popup_init} +{popup_init src="/javascripts/hiermenus.js"} {$title} - {$Name}