assigned variable namespace updates
| From: | Monte Ohrt | Date: | Thu, 12 Dec 2002 16:44:48 +0000 |
| Subject: | assigned variable namespace updates | ||
| Groups: | php.smarty.dev php.smarty.general | ||
| Request: | Send a blank email to php-smarty-dev+get-411@lists.php.net to get a copy of this message | ||
I just committed to CVS some new changes to Smarty, most notably
assigned template variables are no longer extracted into global (PHP)
namespace. This extraction was extraneous and takes processing time,
more for every assigned variable. As a test, I made a template with 1000
assigned variables. The execution time of this template was bettered by
over 30%.
As a consequence, there aren't issues with variable clashing in PHP
namespace with assigned variables. We have to be careful with this,
hopefully no one is using variables in a template that are not
explicitly assigned. If you are, they won't show up anymore!
Also, you can now embed variables in any quoted string, including
modifier arguments.
{include file="$template/foo.tpl"}
{$foo|bar:"I am $name"}
{$foo|bar:"I am \$name"} {* for literal value, escape with \ *}
I unleashed it on our development CMS environment (good test for just
about everything.) It all looks good initially, speed improvement is
noticable!
If you upgrade, do the usual:
*) delete compiled templates
*) delete cached files
*) delete accelerator files
*) restart apache
Please help test if you can!
Monte