From a6f3a518e1818908322d71296c6b023d5752cd03 Mon Sep 17 00:00:00 2001 From: uwetews Date: Sat, 27 May 2017 14:37:35 +0200 Subject: [PATCH] - improvement replace phpversion() by PHP_VERSION constant. https://github.com/smarty-php/smarty/pull/363 --- change_log.txt | 2 ++ libs/Autoloader.php | 6 +++--- libs/Smarty.class.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index 24224e15..3db0cd9e 100644 --- a/change_log.txt +++ b/change_log.txt @@ -3,6 +3,8 @@ - bugfix change compiled code for registered function and modifiers to called as callable to allow closures https://github.com/smarty-php/smarty/pull/368, https://github.com/smarty-php/smarty/issues/273 - bugfix https://github.com/smarty-php/smarty/pull/368 did break the default plugin handler + - improvement replace phpversion() by PHP_VERSION constant. + https://github.com/smarty-php/smarty/pull/363 21.5.2017 - performance store flag for already required shared plugin functions in static variable or diff --git a/libs/Autoloader.php b/libs/Autoloader.php index d3b039ca..3a0da8fa 100644 --- a/libs/Autoloader.php +++ b/libs/Autoloader.php @@ -14,13 +14,13 @@ * require_once '...path/Autoloader.php'; * Smarty_Autoloader::register(); * or - * include '...path/bootstarp.php'; + * include '...path/bootstrap.php'; * * $smarty = new Smarty(); */ class Smarty_Autoloader { - /** + /** * Filepath to Smarty root * * @var string @@ -76,7 +76,7 @@ class Smarty_Autoloader self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR; self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR : self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR; - if (version_compare(phpversion(), '5.3.0', '>=')) { + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend); } else { spl_autoload_register(array(__CLASS__, 'autoload')); diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 857bdea0..38c274b4 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -108,7 +108,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-10'; + const SMARTY_VERSION = '3.1.32-dev-11'; /** * define variable scopes