mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
fixed PHP_VERSION check, misc doc updates
This commit is contained in:
15
FAQ
15
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
|
||||
---------------
|
||||
|
5
NEWS
5
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
|
||||
|
2
README
2
README
@@ -2,7 +2,7 @@ NAME:
|
||||
|
||||
Smarty - the PHP compiling template engine
|
||||
|
||||
VERSION: 1.2.0
|
||||
VERSION: 1.2.1
|
||||
|
||||
AUTHORS:
|
||||
|
||||
|
@@ -281,7 +281,6 @@ class Smarty
|
||||
$new_dir = "";
|
||||
foreach ($compile_dir_parts as $dir_part) {
|
||||
$new_dir .= $dir_part."/";
|
||||
echo "DEBUG: $new_dir<br>\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<br>\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<br>\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);
|
||||
|
@@ -281,7 +281,6 @@ class Smarty
|
||||
$new_dir = "";
|
||||
foreach ($compile_dir_parts as $dir_part) {
|
||||
$new_dir .= $dir_part."/";
|
||||
echo "DEBUG: $new_dir<br>\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<br>\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<br>\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);
|
||||
|
Reference in New Issue
Block a user