From fdef1c65b137a3478bd6599af4803de80eff31bf Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 29 Jan 2001 23:08:50 +0000 Subject: [PATCH] fixed PHP_VERSION check, misc doc updates --- FAQ | 15 ++++++++------- NEWS | 5 +++++ README | 2 +- Smarty.class.php | 5 +++-- libs/Smarty.class.php | 5 +++-- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/FAQ b/FAQ index eed69c70..82b89b5c 100644 --- a/FAQ +++ b/FAQ @@ -16,15 +16,16 @@ A: Most other template engines for PHP provide basic variable substitution and scalable and managable for large application needs. Q: What do you mean "Compiled PHP Scripts" ? -A: What this means is that Smarty reads the template files and creates PHP - scripts from them. Once these PHP scripts are created, Smarty executes - these, never having to parse the template files again. If you change a - template file, Smarty will recreate the PHP script for it. All this is done - automatically by Smarty. Template designers never need to mess with the - generated PHP scripts or even know of their existance. +A: Smarty reads the template files and creates PHP scripts from them. Once + these PHP scripts are created, Smarty executes these, never having to parse + the template files again. If you change a template file, Smarty will + recreate the PHP script for it. All this is done automatically by Smarty. + Template designers never need to mess with the generated PHP scripts or even + know of their existance. Q: Do you have a mailing list? -A: Yes. Subscribe by sending an e-mail to subscribe-smarty@lists.ispi.net +A: Yes. Subscribe by sending an e-mail to subscribe-smarty@lists.ispi.net. This + is also archived at http://marc.theaimsgroup.com/ under www/smarty TROUBLESHOOTING --------------- diff --git a/NEWS b/NEWS index 0b3877c3..528fa648 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +Version 1.2.2 +------------- + - fixed bug using $PHP_VERSION instead of environment var PHP_VERSION. + - couple small warning fixes + Version 1.2.1 ------------- - added $compile_dir, removed $compile_dir_ext, simplified usage diff --git a/README b/README index 02ca37f0..4eaf8b9b 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME: Smarty - the PHP compiling template engine -VERSION: 1.2.0 +VERSION: 1.2.1 AUTHORS: diff --git a/Smarty.class.php b/Smarty.class.php index 02aa8a3f..fb119f78 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -281,7 +281,6 @@ class Smarty $new_dir = ""; foreach ($compile_dir_parts as $dir_part) { $new_dir .= $dir_part."/"; -echo "DEBUG: $new_dir
\n"; if (!file_exists($new_dir) && !mkdir($new_dir, 0755)) { $this->_set_error_msg("problem creating directory \"$this->compile_dir\""); return false; @@ -357,6 +356,8 @@ echo "DEBUG: $new_dir
\n"; $this->_current_line_no += substr_count($template_tags[$i], "\n"); } + $compiled_contents = ""; + /* Interleave the compiled contents and text blocks to get the final result. */ for ($i = 0; $i < count($compiled_tags); $i++) { $compiled_contents .= $text_blocks[$i].$compiled_tags[$i]; @@ -857,7 +858,7 @@ echo "DEBUG: $new_dir
\n"; /* preg_grep() was fixed to return keys properly in 4.0.4 and later. To allow people to use older versions of PHP we emulate preg_grep() and use the version check to see what function to call. */ - if (strnatcmp($PHP_VERSION, '4.0.4') >= 0) { + if (strnatcmp(PHP_VERSION, '4.0.4') >= 0) { $var_exprs = preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:[^|]+)?)*$!', $tokens); $conf_var_exprs = preg_grep('!^#(\w+)#(?>\|@?\w+(:[^|]+)?)*$!', $tokens); $sect_prop_exprs = preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:[^|]+)?)*$!', $tokens); diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 02aa8a3f..fb119f78 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -281,7 +281,6 @@ class Smarty $new_dir = ""; foreach ($compile_dir_parts as $dir_part) { $new_dir .= $dir_part."/"; -echo "DEBUG: $new_dir
\n"; if (!file_exists($new_dir) && !mkdir($new_dir, 0755)) { $this->_set_error_msg("problem creating directory \"$this->compile_dir\""); return false; @@ -357,6 +356,8 @@ echo "DEBUG: $new_dir
\n"; $this->_current_line_no += substr_count($template_tags[$i], "\n"); } + $compiled_contents = ""; + /* Interleave the compiled contents and text blocks to get the final result. */ for ($i = 0; $i < count($compiled_tags); $i++) { $compiled_contents .= $text_blocks[$i].$compiled_tags[$i]; @@ -857,7 +858,7 @@ echo "DEBUG: $new_dir
\n"; /* preg_grep() was fixed to return keys properly in 4.0.4 and later. To allow people to use older versions of PHP we emulate preg_grep() and use the version check to see what function to call. */ - if (strnatcmp($PHP_VERSION, '4.0.4') >= 0) { + if (strnatcmp(PHP_VERSION, '4.0.4') >= 0) { $var_exprs = preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:[^|]+)?)*$!', $tokens); $conf_var_exprs = preg_grep('!^#(\w+)#(?>\|@?\w+(:[^|]+)?)*$!', $tokens); $sect_prop_exprs = preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:[^|]+)?)*$!', $tokens);