From 613e66c257ba6364ef2b06f17eac47d888ceffbb Mon Sep 17 00:00:00 2001 From: uwetews Date: Fri, 25 Dec 2015 10:02:10 +0100 Subject: [PATCH] - optimization replace hhvm extension by inline code --- change_log.txt | 1 + .../smarty_internal_cacheresource_file.php | 3 +- .../smarty_internal_extension_handler.php | 1 - .../smarty_internal_runtime_hhvm.php | 30 ------------------- .../smarty_internal_testinstall.php | 1 - libs/sysplugins/smarty_template_compiled.php | 2 +- 6 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 libs/sysplugins/smarty_internal_runtime_hhvm.php diff --git a/change_log.txt b/change_log.txt index bbc45eae..e195ed64 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@  ===== 3.1.30-dev ===== (xx.xx.xx) 25.12.2015 - compile {block} tag code and its processing into classes + - optimization replace hhvm extension by inline code 24.12.2015 - new feature Compiler does now observe the template_dir setting and will create separate compiled files if required diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index 24dab890..7ae752a0 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -98,7 +98,8 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource $_smarty_tpl = $_template; $_template->cached->valid = false; if ($update && defined('HHVM_VERSION')) { - return $_template->smarty->ext->_hhvm->includeHhvm($_template, $_template->cached->filepath); + eval("?>" . file_get_contents($_template->cached->filepath)); + return true; } else { return @include $_template->cached->filepath; } diff --git a/libs/sysplugins/smarty_internal_extension_handler.php b/libs/sysplugins/smarty_internal_extension_handler.php index 1d87332e..e4d771bd 100644 --- a/libs/sysplugins/smarty_internal_extension_handler.php +++ b/libs/sysplugins/smarty_internal_extension_handler.php @@ -14,7 +14,6 @@ * @property Smarty_Internal_Runtime_TplFunction $_tplFunction * @property Smarty_Internal_Runtime_Var $_var * @property Smarty_Internal_Runtime_Foreach $_foreach - * @property Smarty_Internal_Runtime_Hhvm $_hhvm * @property Smarty_Internal_Runtime_WriteFile $_writeFile * @property Smarty_Internal_Runtime_CodeFrame $_codeFrame * @property Smarty_Internal_Runtime_FilterHandler $_filterHandler diff --git a/libs/sysplugins/smarty_internal_runtime_hhvm.php b/libs/sysplugins/smarty_internal_runtime_hhvm.php deleted file mode 100644 index 117cd816..00000000 --- a/libs/sysplugins/smarty_internal_runtime_hhvm.php +++ /dev/null @@ -1,30 +0,0 @@ - true, 'smarty_internal_runtime_foreach.php' => true, 'smarty_internal_runtime_getincludepath.php' => true, - 'smarty_internal_runtime_hhvm.php' => true, 'smarty_internal_runtime_inheritance.php' => true, 'smarty_internal_runtime_tplfunction.php' => true, 'smarty_internal_runtime_updatecache.php' => true, diff --git a/libs/sysplugins/smarty_template_compiled.php b/libs/sysplugins/smarty_template_compiled.php index e940b808..11e27916 100644 --- a/libs/sysplugins/smarty_template_compiled.php +++ b/libs/sysplugins/smarty_template_compiled.php @@ -169,7 +169,7 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base } $_smarty_tpl = $_template; if (defined('HHVM_VERSION')) { - $_template->smarty->ext->_hhvm->includeHhvm($_template, $_template->compiled->filepath); + eval("?>" . file_get_contents($_template->compiled->filepath)); } else { include($_template->compiled->filepath); }