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