From 799b5cb3424f798f133839fbfdc09b613703cdfe Mon Sep 17 00:00:00 2001 From: uwetews Date: Sun, 19 Aug 2018 02:35:46 +0200 Subject: [PATCH] - fix PSR-2 coding standards and PHPDoc blocks https://github.com/smarty-php/smarty/pull/452 https://github.com/smarty-php/smarty/pull/475 https://github.com/smarty-php/smarty/pull/473 - bugfix PHP5.2 compatibility https://github.com/smarty-php/smarty/pull/472 --- change_log.txt | 9 +- lexer/smarty_internal_configfilelexer.plex | 2 +- lexer/smarty_internal_configfileparser.y | 2 +- lexer/smarty_internal_templatelexer.plex | 2 +- lexer/smarty_internal_templateparser.y | 2 +- libs/Smarty.class.php | 137 +- libs/debug.tpl | 2 +- libs/plugins/block.textformat.php | 49 +- libs/plugins/function.fetch.php | 139 +- libs/plugins/function.html_checkboxes.php | 252 +- libs/plugins/function.html_image.php | 78 +- libs/plugins/function.html_options.php | 179 +- libs/plugins/function.html_radios.php | 217 +- libs/plugins/function.html_select_date.php | 242 +- libs/plugins/function.html_select_time.php | 198 +- libs/plugins/function.html_table.php | 89 +- libs/plugins/function.mailto.php | 56 +- libs/plugins/modifier.debug_print_var.php | 145 +- libs/plugins/modifier.escape.php | 372 ++- libs/plugins/modifier.mb_wordwrap.php | 2 +- libs/plugins/modifiercompiler.escape.php | 96 +- libs/plugins/modifiercompiler.unescape.php | 30 +- libs/plugins/shared.mb_str_replace.php | 2 +- libs/sysplugins/smarty_cacheresource.php | 4 +- .../smarty_internal_cacheresource_file.php | 2 +- .../smarty_internal_compile_block.php | 2 +- .../smarty_internal_compile_capture.php | 1 - ...arty_internal_compile_private_modifier.php | 178 +- ...ernal_compile_private_special_variable.php | 146 +- .../smarty_internal_compile_section.php | 148 +- .../smarty_internal_configfilelexer.php | 196 +- .../smarty_internal_configfileparser.php | 188 +- libs/sysplugins/smarty_internal_data.php | 18 +- libs/sysplugins/smarty_internal_debug.php | 4 +- .../smarty_internal_errorhandler.php | 1 - .../smarty_internal_extension_handler.php | 8 +- ..._internal_method_clearcompiledtemplate.php | 2 +- .../smarty_internal_method_configload.php | 1 - .../smarty_internal_method_createdata.php | 2 +- .../smarty_internal_resource_stream.php | 2 - .../smarty_internal_runtime_cachemodify.php | 60 +- ...rty_internal_runtime_cacheresourcefile.php | 2 +- libs/sysplugins/smarty_internal_template.php | 210 +- .../smarty_internal_templatebase.php | 8 +- .../smarty_internal_templatecompilerbase.php | 15 +- .../smarty_internal_templatelexer.php | 211 +- .../smarty_internal_templateparser.php | 2521 ++++++++--------- .../smarty_internal_testinstall.php | 26 +- libs/sysplugins/smarty_security.php | 17 +- libs/sysplugins/smarty_template_compiled.php | 4 +- utilities/BuildExpectedFiles.php | 8 +- 51 files changed, 2869 insertions(+), 3418 deletions(-) diff --git a/change_log.txt b/change_log.txt index 982a7e8e..f82c9ee4 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,11 @@ -===== 3.1.33-dev-4 ===== +===== 3.1.33-dev-6 ===== +19.08.2018 + - fix PSR-2 coding standards and PHPDoc blocks https://github.com/smarty-php/smarty/pull/452 + https://github.com/smarty-php/smarty/pull/475 + https://github.com/smarty-php/smarty/pull/473 + - bugfix PHP5.2 compatibility https://github.com/smarty-php/smarty/pull/472 + +===== 3.1.33-dev-4 ===== 17.05.2018 - bugfix strip-block produces different output in Smarty v3.1.32 https://github.com/smarty-php/smarty/issues/436 - bugfix Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437 diff --git a/lexer/smarty_internal_configfilelexer.plex b/lexer/smarty_internal_configfilelexer.plex index 67887a4a..5e61f338 100644 --- a/lexer/smarty_internal_configfilelexer.plex +++ b/lexer/smarty_internal_configfilelexer.plex @@ -124,7 +124,7 @@ class Smarty_Internal_Configfilelexer * @param string $data template source * @param Smarty_Internal_Config_File_Compiler $compiler */ - function __construct($data, Smarty_Internal_Config_File_Compiler $compiler) + public function __construct($data, Smarty_Internal_Config_File_Compiler $compiler) { $this->data = $data . "\n"; //now all lines are \n-terminated $this->dataLength = strlen($data); diff --git a/lexer/smarty_internal_configfileparser.y b/lexer/smarty_internal_configfileparser.y index f5e70737..c981b58e 100644 --- a/lexer/smarty_internal_configfileparser.y +++ b/lexer/smarty_internal_configfileparser.y @@ -89,7 +89,7 @@ class Smarty_Internal_Configfileparser * @param Smarty_Internal_Configfilelexer $lex * @param Smarty_Internal_Config_File_Compiler $compiler */ - function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Config_File_Compiler $compiler) + public function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Config_File_Compiler $compiler) { $this->lex = $lex; $this->smarty = $compiler->smarty; diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex index 52ee2d7b..64a39310 100644 --- a/lexer/smarty_internal_templatelexer.plex +++ b/lexer/smarty_internal_templatelexer.plex @@ -215,7 +215,7 @@ class Smarty_Internal_Templatelexer * @param string $source template source * @param Smarty_Internal_TemplateCompilerBase $compiler */ - function __construct($source, Smarty_Internal_TemplateCompilerBase $compiler) + public function __construct($source, Smarty_Internal_TemplateCompilerBase $compiler) { $this->data = $source; $this->dataLength = strlen($this->data); diff --git a/lexer/smarty_internal_templateparser.y b/lexer/smarty_internal_templateparser.y index d53cdf2d..8fcd5f34 100644 --- a/lexer/smarty_internal_templateparser.y +++ b/lexer/smarty_internal_templateparser.y @@ -147,7 +147,7 @@ class Smarty_Internal_Templateparser * @param Smarty_Internal_Templatelexer $lex * @param Smarty_Internal_TemplateCompilerBase $compiler */ - function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) + public function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) { $this->lex = $lex; $this->compiler = $compiler; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 1352d815..a0e5fbd4 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.33-dev-5'; + const SMARTY_VERSION = '3.1.33-dev-6'; /** * define variable scopes */ @@ -166,133 +166,157 @@ class Smarty extends Smarty_Internal_TemplateBase const PLUGIN_COMPILER = 'compiler'; const PLUGIN_MODIFIER = 'modifier'; const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'; + /** * assigned global tpl vars */ public static $global_tpl_vars = array(); + /** * Flag denoting if Multibyte String functions are available */ public static $_MBSTRING = SMARTY_MBSTRING; + /** * The character set to adhere to (e.g. "UTF-8") */ public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; + /** * The date format to be used internally * (accepts date() and strftime()) */ public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT; + /** * Flag denoting if PCRE should run in UTF-8 mode */ public static $_UTF8_MODIFIER = 'u'; + /** * Flag denoting if operating system is windows */ public static $_IS_WINDOWS = false; + /** * auto literal on delimiters with whitespace * * @var boolean */ public $auto_literal = true; + /** * display error on not assigned variables * * @var boolean */ public $error_unassigned = false; + /** * look up relative file path in include_path * * @var boolean */ public $use_include_path = false; + /** * flag if template_dir is normalized * * @var bool */ public $_templateDirNormalized = false; + /** * joined template directory string used in cache keys * * @var string */ public $_joined_template_dir = null; + /** * flag if config_dir is normalized * * @var bool */ public $_configDirNormalized = false; + /** * joined config directory string used in cache keys * * @var string */ public $_joined_config_dir = null; + /** * default template handler * * @var callable */ public $default_template_handler_func = null; + /** * default config handler * * @var callable */ public $default_config_handler_func = null; + /** * default plugin handler * * @var callable */ public $default_plugin_handler_func = null; + /** * flag if template_dir is normalized * * @var bool */ public $_compileDirNormalized = false; + /** * flag if plugins_dir is normalized * * @var bool */ public $_pluginsDirNormalized = false; + /** * flag if template_dir is normalized * * @var bool */ public $_cacheDirNormalized = false; + /** * force template compiling? * * @var boolean */ public $force_compile = false; - /** - * use sub dirs for compiled/cached files? - * - * @var boolean - */ + + /** + * use sub dirs for compiled/cached files? + * + * @var boolean + */ public $use_sub_dirs = false; + /** * allow ambiguous resources (that are made unique by the resource handler) * * @var boolean */ public $allow_ambiguous_resources = false; + /** * merge compiled includes * * @var boolean */ public $merge_compiled_includes = false; + /* * flag for behaviour when extends: resource and {extends} tag are used simultaneous * if false disable execution of {extends} in templates called by extends resource. @@ -301,30 +325,35 @@ class Smarty extends Smarty_Internal_TemplateBase * @var boolean */ public $extends_recursion = true; + /** * force cache file creation * * @var boolean */ public $force_cache = false; + /** * template left-delimiter * * @var string */ public $left_delimiter = "{"; + /** * template right-delimiter * * @var string */ public $right_delimiter = "}"; + /** * array of strings which shall be treated as literal by compiler * * @var array string */ public $literals = array(); + /** * class name * This should be instance of Smarty_Security. @@ -333,24 +362,28 @@ class Smarty extends Smarty_Internal_TemplateBase * @see Smarty_Security */ public $security_class = 'Smarty_Security'; + /** * implementation of security class * * @var Smarty_Security */ public $security_policy = null; + /** * controls handling of PHP-blocks * * @var integer */ public $php_handling = self::PHP_PASSTHRU; + /** * controls if the php template file resource is allowed * * @var bool */ public $allow_php_templates = false; + /** * debug mode * Setting this to true enables the debug-console. @@ -358,6 +391,7 @@ class Smarty extends Smarty_Internal_TemplateBase * @var boolean */ public $debugging = false; + /** * This determines if debugging is enable-able from the browser. *