diff --git a/change_log.txt b/change_log.txt index 9a28b699..8991516d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -9,6 +9,7 @@ - optimize autoloader - optimize file path normalization - bugfix PATH_SEPARATOR was replaced by mistake in autoloader + - remove redundant code 27.06.2015 - bugfix resolve naming conflict between custom Smarty delimiter '<%' and PHP ASP tags https://github.com/smarty-php/smarty/issues/64 diff --git a/libs/sysplugins/smarty_internal_extension_loadplugin.php b/libs/sysplugins/smarty_internal_extension_loadplugin.php index ff268568..37ac1fdd 100644 --- a/libs/sysplugins/smarty_internal_extension_loadplugin.php +++ b/libs/sysplugins/smarty_internal_extension_loadplugin.php @@ -49,8 +49,6 @@ class Smarty_Internal_Extension_LoadPlugin // plugin filename is expected to be: [type].[name].php $_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php"; - $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); - // loop through plugin dirs and find the plugin foreach ($smarty->getPluginsDir() as $_plugin_dir) { $names = array($_plugin_dir . $_plugin_filename, $_plugin_dir . strtolower($_plugin_filename),); @@ -61,15 +59,9 @@ class Smarty_Internal_Extension_LoadPlugin } if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) { // try PHP include_path - if ($_stream_resolve_include_path) { - $file = stream_resolve_include_path($file); - } else { - $file = Smarty_Internal_Get_Include_Path::getIncludePath($file); - } - + $file = Smarty_Internal_Get_Include_Path::getIncludePath($file); if ($file !== false) { require_once($file); - return $file; } } diff --git a/libs/sysplugins/smarty_internal_resource_file.php b/libs/sysplugins/smarty_internal_resource_file.php index ff28c229..ccc9ff4b 100644 --- a/libs/sysplugins/smarty_internal_resource_file.php +++ b/libs/sysplugins/smarty_internal_resource_file.php @@ -30,7 +30,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { $file = $source->name; // absolute file ? - if ($file[0] == '/' || $file[1] == ':' ) { + if ($file[0] == '/' || $file[1] == ':') { $file = $source->smarty->_realpath($file); return is_file($file) ? $file : false; } @@ -90,11 +90,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource } if ($source->smarty->use_include_path && !preg_match('/^([\\\/]|[a-zA-Z]:[\\\/])/', $_directory)) { // try PHP include_path - if (function_exists('stream_resolve_include_path')) { - $_filepath = stream_resolve_include_path($_filepath); - } else { - $_filepath = Smarty_Internal_Get_Include_Path::getIncludePath($_filepath); - } + $_filepath = Smarty_Internal_Get_Include_Path::getIncludePath($_filepath); if ($_filepath !== false) { $path = $source->smarty->_realpath($_filepath); if (is_file($path)) { @@ -108,7 +104,6 @@ class Smarty_Internal_Resource_File extends Smarty_Resource return is_file($path) ? $path : false; } - /** * test is file exists and save timestamp *