- smaller speed optimization

This commit is contained in:
uwetews
2016-11-11 23:09:28 +01:00
parent be054c1727
commit 05933749c0
2 changed files with 5 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
11.11.2016
- bugfix when Smarty is using a cached template object on Smarty::fetch() or Smarty::isCached() the inheritance data
must be removed https://github.com/smarty-php/smarty/issues/312
- smaller speed optimization
08.11.2016
- add bootstrap file to load and register Smarty_Autoloader. Change composer.json to make it known to composer

View File

@@ -108,7 +108,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.31-dev/43';
const SMARTY_VERSION = '3.1.31-dev/44';
/**
* define variable scopes
@@ -1265,8 +1265,9 @@ class Smarty extends Smarty_Internal_TemplateBase
*
* @return bool
*/
public function _isNewRelease ($dir) {
if (!is_file($file = $dir. 'version.txt') || file_get_contents($file) !== Smarty::SMARTY_VERSION) {
public function _isNewRelease($dir)
{
if (!is_file($file = $dir . preg_replace('#[^a-zA-Z0-9.-]#', '.', Smarty::SMARTY_VERSION) . 'version.txt')) {
file_put_contents($file, Smarty::SMARTY_VERSION);
return true;
} else {