2001-04-11 20:54:35 +00:00
|
|
|
1.4.0
|
|
|
|
-----
|
|
|
|
|
2001-04-12 20:53:21 +00:00
|
|
|
The most significant change to Smarty 1.4.0 is the compilation process. Instead
|
|
|
|
of compiling all the templates up front, it now compiles them at runtime. This
|
|
|
|
has several advantages. First off, there is no longer a need to have a single
|
2001-04-11 20:54:35 +00:00
|
|
|
template directory. You can now have arbitrary template sources, such as
|
2001-04-12 20:53:21 +00:00
|
|
|
multiple directories or even database calls. This also speeds the performance of
|
|
|
|
Smarty when $compile_check is enabled, since it is only checking the template
|
|
|
|
that is being executed instead of everything found in the template directory.
|
|
|
|
The $tpl_file_ext variable was removed since this is no longer needed, so
|
|
|
|
templates can be named anything you like with any extension. Smarty makes use of
|
|
|
|
the PEAR database abstraction class for obtaining templates from databases. Now
|
|
|
|
aren't you glad we require PEAR :-)
|
2001-04-11 20:54:35 +00:00
|
|
|
|
2001-04-12 20:53:21 +00:00
|
|
|
We also added a workaround for LOCK_EX on Windows systems, and changed a couple
|
2001-04-11 20:54:35 +00:00
|
|
|
of file permissions for better security on public servers. Thanks goes to
|
|
|
|
Fernando Nunes for his code contributions.
|
|
|
|
|
|
|
|
date_format, html_select_date and html_select_time used to require a unix
|
|
|
|
timestamp as the format of the date passed into the template. Smarty is now a
|
|
|
|
bit smarter at this. It will take a unix timestamp, a mysql timestamp, or any
|
|
|
|
date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01,
|
|
|
|
etc. Just give it a try and see what works.
|
|
|
|
|
|
|
|
When upgrading to 1.4.0, you will want to first clear out all your files in the
|
|
|
|
$compile_dir, since it now uses a new format. Since templates can come from any
|
|
|
|
source, the compiled versions have encoded names. Each file has a comment at
|
|
|
|
the top that states which resource was used as the source file. In unix, "head
|
|
|
|
-2 *" shows the first two lines of each file. If you have $compile_check set to
|
|
|
|
false and the compiled template does not yet exist, it will compile it
|
2001-04-12 20:53:21 +00:00
|
|
|
regardless of this setting. Once it is compiled though, it will not check to see
|
|
|
|
if recompilation is necessary.
|
2001-04-11 20:54:35 +00:00
|
|
|
|
|
|
|
-Monte
|