source: branches/rel/data/module/Smarty/RELEASE_NOTES @ 12157

Revision 12157, 18.5 KB checked in by uehara, 17 years ago (diff)
Line 
12.6.7
2-----
3
4Those using Smarty with security enabled: a hole was found that allowed PHP code to be executed from within a template file. This has been fixed and you are engouraged to upgrade immediately. Note that this hole does NOT affect the security of your web server or PHP applications, only the ability for someone editing a template to execute PHP code. Other changes in this release can be found in the NEWS file.
5
62.5.0
7-----
8
9Very minor adjustments since RC2, see the NEWS file for details.
10
112.5.0-RC2
12---------
13
14Many fixes since the RC1 release. This one is as close to production quality as
15they come, so this will be the last release before 2.5.0. The SGML documentation
16files have also been removed from the tarball. If you want them, get them from
17the CVS repository.
18
192.5.0-RC1
20---------
21
22Release Candidate 1. All $smarty vars can now be dynamic, such as
23$smarty.get.$foo. A new class function get_function_object() gets you a
24reference to an assigned object, useful within your own custom functions.
25append() can now merge as well as append with a third optional attribute. A new
26class function get_config_vars() was added, and get_template_vars() can now be
27used to get individual vars. Full variable syntax is now supported within
28double quotes via a backtick (`) syntax. Files created by smarty are now
29written to a tmp file then renamed to avoid file lock retention. html_radios,
30html_checkboxes, html_table, html_image, nl2br functions added, see the NEWS
31file for full details.
32
332.4.2
34-----
35Another point release. Added support for dynamic object reference syntax
36($foo->$bar), support for full variable syntax within quotes ("$foo[0].bar"),
37and other minor fixes. See the NEWS file for full details.
38
392.4.1
40-----
41
42This is basically a point release, cleaning up a few things caught
43in the 2.4.0 release. See the NEWS file for full details.
44
452.4.0
46-----
47
48Smarty now supports the ability to access objects within the templates. Two
49methods are available, one which closely follows Smartys conventions, and
50another that follows more traditional object syntax for those familiar with
51PHP.
52
53The internal compiling engine has also undergone some major work. The regex
54parsing was rewritten to be much more strict, more secure and more
55maintainable. Config files are now compiled, which can speed up pages quite a
56bit that use config files extensively. Assigned variables are no longer
57extracted to PHP namespace, saving an extract call for every template. There is
58now support for applying modifiers to static values and functions. You can now
59access constants with $smarty.const.VAR.  See the NEWS file for complete
60changes.
61 
622.3.1
63-----
64
65The mtime on compiled files will now match the source files, in the case where
66the source file may not get the current timestamp, recompiling will still work
67as expected. Proper support for open_basedir has been added, so Smarty should
68work correctly in safe mode. Added a few new features such as textformat block
69function, strip variable modifier and optgroup support for html_options. Also
70other minor bug fixes, see the Change Log.
71
722.3.0
73-----
74
75Smarty now has a {debug} template function that brings up the debugging console
76right where {debug} is called, regardless of $debugging settings. This works a
77little different than turning on $debugging in the sense that it shows all the
78template variables available at the time {debug} is called, including local
79scope vars. It does not show the templates names however, since this
80executed during runtime of the template.
81
82You can now supply an expire time when clearing cache or compile files. This is
83mostly useful for removing stale files via the API.
84
85Plugins now stop execution upon error, instead of outputting a warning and
86continuing.
87
88Two new API functions, assign_by_ref() and append_by_ref() were added. They
89allow assigning template variables by reference. This can make a significant
90performance gain, especially if you are assigning large arrays of data. PHP 5.0
91will do this implicitly, so these functions are basically workarounds.
92
93Several misc bug fixes, see the Change Log for information.
94
95
962.2.0
97-----
98
99Smarty now allows an array of paths for the $plugin_dir class variable. The
100directories will be searched in the order they are given, so for efficiency keep
101the most-used plugins at the top. Also, absolute paths to the plugin directories are
102more efficient than relying on the PHP include_path.
103
104Cache files can now be grouped with the cache_id. See the documentation under
105the new "Caching" section for details. compile_id also respects the same
106grouping syntax. The cache/compile file structure changed, so be sure to clear
107out all your cache and compile files when upgrading Smarty. Also if you are
108using PHP-accelerator, restart apache. I've seen some quirky things happen if
109the phpa files do not get cleared (known issue with phpa and parent
110class-member changes, so just clear 'em.)
111
112Smarty now correctly respects the PHP include_path for $template_dir, $compile_dir,
113$cache_dir, $config_dir and $plugin_dir. Be aware that relying on the
114include_path is an overhead, try to use absolute pathnames when possible
115(or relative to working directory.)
116
117Documentation has been updated and rearranged a bit. Most notably, the
118installation instructions are completely revamped, and a new Caching section
119explains Smarty's caching in detail along with the new grouping functionality.
120
121Many misc. bug fixes and enhancements, see the full ChangeLog (NEWS file) for
122details.
123
1242.1.1
125-----
126
127There was a bug with template paths and the include_path, this has been fixed.
128Also register_outputfilter() did not work, this is fixed. A new template
129function named "cycle" has been added to the distribution, nice for cycling
130through a list (or array) of values.
131
1322.1.0
133-----
134
135This release has quite a few new features and fixes. Most notable are the
136introduction of block functions, so you can write plugins that work on a block
137of text with {func}{/func} notation. Also output filters were added, so you can
138apply a function against the output of your templates. This differs from the
139postfilter function, which works on the compiled template at compile time, and
140output filters work on the template output at runtime.
141
142Many other features and bug fixes are noted in the NEWS file.
143
144
1452.0.1
146-----
147
148This is a point release, fixing a few bugs and cleaning things up. A plugin
149was renamed, the dash "-" was removed from compiled template and cached file
150names. If you're upgrading, you might want to clear them out first.  See the
151ChangeLog for details.
152
1532.0.0
154-----
155
156This release is a huge milestone for Smarty. Most notable new things are a
157plugin architecture, removal of PEAR dependency, and optimizations that
158drastically improve the performance of Smarty in most cases.
159
160The plugin architecture allows modifiers, custom functions, compiler functions,
161prefilters, postfilters, resources, and insert functions to be added by
162simply dropping a file into the plugins directory. Once dropped in, they are
163automatically registered by the template engine. This makes user-contributed
164plugins easy to manage, as well as the internal workings of Smarty easy to
165control and customize. This new architecture depends on the __FILE__ constant,
166which contains the full path to the executing script. Some older versions of
167PHP incorrectly gave the script name and not the full filesystem path. Be sure
168your version of PHP populates __FILE__ correctly. If you use custom template
169resource functions, the format of these changed with the plugin architecture.
170Be sure to update your functions accordingly. See the template resource section
171of the documentation.
172
173The PEAR dependancy was removed from Smarty. The Config_File class that comes
174with Smarty was actually what needed PEAR for error handling which Smarty didn't
175use, but now everything is self-contained.
176
177Performance improvements are graphed on the benchmark page, you will see that
178overall performance has been sped up by as much as 80% in some cases.
179
180Smarty-cached pages now support If-Modified-Since headers, meaning that if a
181cached template page has not changed since the last request, a "304 Not
182Modified" header will be sent instead of resending the same page. This is
183disabled by default, change the setting of $cache_modified_check.
184
185
1861.5.2
187-----
188
189Mostly bug fixes, added a default template resource handler.
190
191
1921.5.1
193-----
194
195Critical bug fix release. If you use caching, you'll need to upgrade.
196
197
1981.5.0
199-----
200
201Several feature enhancements were made to this version, most notably the
202{foreach ...} command which is an alternative to {section ...} with an easier
203syntax for looping through a single array of values. Several functions were
204enhanced so that the output can be automatically assigned to a template
205variable instead of displayed (assign attribute). Cache files can now be
206controlled with a custom function as an alternative to the built-in file based
207method. Many code cleanups and bug fixed went into this release as well.
208
209
2101.4.6
211-----
212
213The behavior with caching and compile_check has been slightly enhanced. If
214caching is enabled AND compile_check is enabled, the cache will immediately get
215regenerated if _any_ involved template or config file is updated. This imposes
216a slight performance hit because it must check all the files for changes, so be
217sure to run live sites with caching enabled and compile_check disabled for best
218performance. If you update a template or config file, simply turn on
219compile_check, load the page, then turn it back off. This will update the cache
220file with the new content. This is accomplished by maintaining a list of
221included/loaded templates and config files at the beginning of the cache file.
222Therefore it is advisable to remove all cache files after upgrading to 1.4.6
223(although not absolutely necessary, old cache files will regenerate)
224
225The debug console now has script timing and array values printed. You MUST
226update your debug.tpl file with this version of Smarty. Also, the new debug.tpl
227will not work with older versions of Smarty.
228
229
2301.4.5
231-----
232
233Mostly bug fixes and minor improvements. Added compile id for separate compiled
234versions of the same script. The directory format and filename convention for
235the files in templates_c has changed, so you may want to remove all of the
236existing ones before you upgrade.
237
238
2391.4.4
240-----
241
242A few bug fixes, new section looping attributes and properties, debugging
243console function for control via URL, and overLib integration and access
244to request variables from within the template.
245
246
2471.4.3
248-----
249
250This release has a few bug fixes and several enhancements. Smarty now supports
251template security for third-party template editing. These features disallow the
252ability for someone to execute commands or PHP code from the template language.
253Smarty also now has a built-in debugging console, which is a javascript pop-up
254window that displays all the included template names and assigned variables.
255
256
2571.4.2
258-----
259
260This was mostly one bug fix with variable scoping within included templates
261and a few documentation changes and updates. See the ChangeLog file for full
262details.
263
264
2651.4.1
266-----
267
268It seems that the EX_LOCK logic from the previous release didn't fix all the
269problems with windows platforms. Hopefully this one does. It basically
270disables file locking on windows, so there is a potential that two programs
271could write over the same file at the same time, fyi.
272
273The reset is minor bug fixes, please refer to the ChangeLog file.
274
275
2761.4.0
277-----
278
279IMPORTANT NOTICE
280
281Smarty now has a new syntax for accessing elements within section loops. The
282new syntax is easier to use and nicely handles data structures of any
283complexity. Consequently, this breaks the old syntax.
284
285Here is an example of the syntax change:
286
287old syntax:
288{$sec1/sec2/sec3/customer.phone}
289
290new syntax:
291{$customer[$sec1][$sec2][$sec3].phone}
292
293The section names used to come first, followed by the variable name. Now the
294variable name always comes first, followed by the section names in brackets.
295You can access variable indexes anywhere, depending on how you passed the
296variables in.
297
298To fix your current templates, we have provided a script that will adjust the
299syntax for you. Located in misc/fix_vars.php, run this script from the the
300command line, giving each template as an argument. Be sure to use absolute
301pathnames, or pathnames relative to the executing script. Probably the easiest
302way to do this is to copy the fix_vars.php script into your template directory
303and run 'php -q fix_vars.php *.tpl' Be sure you have proper write permission,
304and backup your scripts first to be safe! The examples in the 1.4.0
305documentation have been updated to reflect the changes.
306
307cd /path/to/templates
308cp /path/to/fix_vars.php .
309find . -name "*.tpl" -exec php -q ./fix_vars.php {} \;
310
311NEW AND IMPROVED COMPILATION PROCESS
312
313Smarty 1.4.0 also has a new compilation process. Instead of compiling all the
314templates up front, it now compiles them at runtime. This has several
315advantages. First of all, there is no longer a need to have a single template
316directory. You can now have arbitrary template sources, such as multiple
317directories or even database calls. This also speeds the performance of Smarty
318when $compile_check is enabled, since it is only checking the template that is
319being executed instead of everything found in the template directory. The
320$tpl_file_ext is no longer needed, but kept for backward compatability.
321Templates can now be named anything you like with any extension.
322
323MINOR FIXES
324
325A workaround for LOCK_EX on Windows systems was added, and changed a couple of
326file permissions for better security on public servers.
327
328$show_info_header is now defaulted to false instead of true. This header causes
329problems when displaying content other than HTML, so now you must explicitly
330set this flag to true to show the header information (or change the default in
331your copy of Smarty.)
332
333Documentation is written in docbook format. I updated the docbook -> HTML
334generating software & style-sheets, and consequently the examples are no longer
335in a different background color. If anyone wants to contribute a better
336stylesheet or help with documentation, drop me a line. <monte at ohrt dot com>
337
338CHANGES/ENHANCEMENTS/UPDATES
339
340date_format, html_select_date and html_select_time used to require a unix
341timestamp as the format of the date passed into the template. Smarty is now a
342bit smarter at this. It will take a unix timestamp, a mysql timestamp, or any
343date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01,
344etc. Just give some formats a try and see what works.
345
346Smarty now has template prefilters, meaning that you can run your templates
347through custom functions before they are compiled. This is good for things like
348removing unwanted comments, keeping an eye on words or functionality people are
349putting in templates, translating XML -> HTML, etc. See the register_prefilter
350documentation for more info.
351
352Another addition are the so-called compiler functions. These are custom
353functions registered by the user that are executed at compilation time of the
354template. They can be used to inject PHP code or time-sensitive static content
355into the compiled template.
356
357The run-time custom functions are now passed the Smarty object as the second
358parameter. This can be used, for example, to assign or clear template variables
359from inside the custom function.
360
361clear_compile_dir() was added for clearing out compiled versions of your
362templates. Not something normally needed, but you may have a need for this if
363you have $compile_check set to false and you periodically update templates via
364some automated process. As of 1.4.0, uncompiled templates _always_ get
365compiled regardless of $compile_check setting, although they won't be checked
366for recompile if $compile_check is set to false.
367
368You can now refer to properties of objects assigned from PHP by using the '->'
369symbol and specifying the property name after it, e.g. $foo->bar.
370
371{php}{/php} tags were added to embed php into the templates. Not normally
372needed, but some circumstances may call for it. Check out the "componentized
373templates" tip in the documentation for an example.
374
375{capture}{/capture} and {counter} functions were added. See the documentation
376for a complete description and examples.
377
378UPGRADE NOTES
379
380The format of the files created in the $compile_dir are now a bit different.
381The compiled template filename is the template resource name url-encoded.
382Therefore, all compiled files are now in the top directory of $compile_dir.
383This was done to make way for arbitrary template resources. Each compiled
384template also has a header that states what template resource was used to
385create it. From a unix command prompt, you can use "head -2 *" to see the first
386two lines of each file.
387
388When upgrading to 1.4.0, you will want to clear out all your old files in the
389$compile_dir. If you have $compile_check set to false and the compiled template
390does not yet exist, it will compile it regardless of this setting. This way you
391can clear out the $compile_dir and not worry about setting $compile_check to
392true to get the inital compilation under way.
393
394
3951.3.2
396-----
397
398Smarty now has (an optional) header prepended to the output of the Smarty
399templates. This displays the Smarty version and the date/time when the page was
400generated. This is useful for debugging your cache routines, and purely
401informational so there is evidence that the page was generated by Smarty. Set
402$show_info_header to false to disable it.
403
404{config_load ...} performance was tuned by placing the loaded variables into a
405global array, so basically a config file is read from the file system and
406placed into a php array structure only once, no matter how many times it is
407called in any of the templates. The scope of the loaded variables has changed a
408bit as well. Variables loaded by config_load used to be treated as global
409variables, meaning that parent templates (templates that included the current
410template) could see them. Now the default behavior is such that loaded
411variables are only visible by the current template and child templates (all
412templates included after the {config_load ...} is called.) To mimic the
413original behavior, provide the attribute "global=yes" like so: {config_load
414file="mystuff.conf" global=yes}. Now when you load in mystuff.conf, the
415variables will be visible to parent templates (merged with any existing config
416variables.)
417
418A formatting attribute was added to the {math ...} function, adding the ability
419to control the format of the output. Use the same formatting syntax as the PHP
420function sprintf().
421
422{html_select_time ...} was added, a custom function that works much like
423{html_select_date ...} except it displays time elements instead of dates.
424
425A few custom modifiers were added: count_characters, count_words,
426count_sentences, count_paragraphs. All pretty self-explanatory.
427
428/* vim: set et: */
Note: See TracBrowser for help on using the repository browser.