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