Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / CHANGELOG
1 * 1.34.3 (2017-06-07)
2
3  * fixed namespaces introduction
4
5 * 1.34.2 (2017-06-05)
6
7  * fixed namespaces introduction
8
9 * 1.34.1 (2017-06-05)
10
11  * fixed namespaces introduction
12
13 * 1.34.0 (2017-06-05)
14
15  * added support for PHPUnit 6 when testing extensions
16  * fixed PHP 7.2 compatibility
17  * fixed template name generation in Twig_Environment::createTemplate()
18  * removed final tag on Twig_TokenParser_Include
19  * added namespaced aliases for all (non-deprecated) classes and interfaces
20  * dropped HHVM support
21  * dropped PHP 5.2 support
22
23 * 1.33.2 (2017-04-20)
24
25  * fixed edge case in the method cache for Twig attributes
26
27 * 1.33.1 (2017-04-18)
28
29  * fixed the empty() test
30
31 * 1.33.0 (2017-03-22)
32
33  * fixed a race condition handling when writing cache files
34  * "length" filter now returns string length when applied to an object that does
35    not implement \Countable but provides __toString()
36  * "empty" test will now consider the return value of the __toString() method for
37    objects implement __toString() but not \Countable
38  * fixed JS escaping for unicode characters with higher code points
39
40 * 1.32.0 (2017-02-26)
41
42  * fixed deprecation notice in Twig_Util_DeprecationCollector
43  * added a PSR-11 compatible runtime loader
44  * added `side` argument to `trim` to allow left or right trimming only.
45
46 * 1.31.0 (2017-01-11)
47
48  * added Twig_NodeCaptureInterface for nodes that capture all output
49  * fixed marking the environment as initialized too early
50  * fixed C89 compat for the C extension
51  * turned fatal error into exception when a previously generated cache is corrupted
52  * fixed offline cache warm-ups for embedded templates
53
54 * 1.30.0 (2016-12-23)
55
56  * added Twig_FactoryRuntimeLoader
57  * deprecated function/test/filter/tag overriding
58  * deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr
59
60 * 1.29.0 (2016-12-13)
61
62  * fixed sandbox being left enabled if an exception is thrown while rendering
63  * marked some classes as being final (via @final)
64  * made Twig_Error report real source path when possible
65  * added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 (replaces {{ _self.templateName }})
66  * deprecated silent display of undefined blocks
67  * deprecated support for mbstring.func_overload != 0
68
69 * 1.28.2 (2016-11-23)
70
71  * fixed precedence between getFoo() and isFoo() in Twig_Template::getAttribute()
72  * improved a deprecation message
73
74 * 1.28.1 (2016-11-18)
75
76  * fixed block() function when used with a template argument
77
78 * 1.28.0 (2016-11-17)
79
80  * added support for the PHP 7 null coalescing operator for the ?? Twig implementation
81  * exposed a way to access template data and methods in a portable way
82  * changed context access to use the PHP 7 null coalescing operator when available
83  * added the "with" tag
84  * added support for a custom template on the block() function
85  * added "is defined" support for block() and constant()
86  * optimized the way attributes are fetched
87
88 * 1.27.0 (2016-10-25)
89
90  * deprecated Twig_Parser::getEnvironment()
91  * deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
92  * deprecated Twig_Compiler::addIndentation()
93  * fixed regression when registering two extensions having the same class name
94  * deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead)
95  * fixed the filesystem loader with relative paths
96  * deprecated Twig_Node::getLine() in favor of Twig_Node::getTemplateLine()
97  * deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext()
98  * deprecated Twig_Node::getFilename() in favor of Twig_Node::getTemplateName()
99  * deprecated the "filename" escaping strategy (use "name" instead)
100  * added Twig_Source to hold information about the original template
101  * deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() in favor of Twig_Error::getTemplateName() and Twig_Error::setTemplateName()
102  * deprecated Parser::getFilename()
103  * fixed template paths when a template name contains a protocol like vfs://
104  * improved debugging with Twig_Sandbox_SecurityError exceptions for disallowed methods and properties
105
106 * 1.26.1 (2016-10-05)
107
108  * removed template source code from generated template classes when debug is disabled
109  * fixed default implementation of Twig_Template::getDebugInfo() for better BC
110  * fixed regression on static calls for functions/filters/tests
111
112 * 1.26.0 (2016-10-02)
113
114  * added template cache invalidation based on more environment options
115  * added a missing deprecation notice
116  * fixed template paths when a template is stored in a PHAR file
117  * allowed filters/functions/tests implementation to use a different class than the extension they belong to
118  * deprecated Twig_ExtensionInterface::getName()
119
120 * 1.25.0 (2016-09-21)
121
122  * changed the way we store template source in template classes
123  * removed usage of realpath in cache keys
124  * fixed Twig cache sharing when used with different versions of PHP
125  * removed embed parent workaround for simple use cases
126  * deprecated the ability to store non Node instances in Node::$nodes
127  * deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler()
128  * deprecated Twig_Compiler::getFilename()
129
130 * 1.24.2 (2016-09-01)
131
132  * fixed static callables
133  * fixed a potential PHP warning when loading the cache
134  * fixed a case where the autoescaping does not work as expected
135
136 * 1.24.1 (2016-05-30)
137
138  * fixed reserved keywords (forbids true, false, null and none keywords for variables names)
139  * fixed support for PHP7 (Throwable support)
140  * marked the following methods as being internals on Twig_Environment: 
141    getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
142    getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
143    getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()
144
145 * 1.24.0 (2016-01-25)
146
147  * adding support for the ?? operator
148  * fixed the defined test when used on a constant, a map, or a sequence
149  * undeprecated _self (should only be used to get the template name, not the template instance)
150  * fixed parsing on PHP7
151
152 * 1.23.3 (2016-01-11)
153
154  * fixed typo
155
156 * 1.23.2 (2015-01-11)
157
158  * added versions in deprecated messages
159  * made file cache tolerant for trailing (back)slashes on directory configuration
160  * deprecated unused Twig_Node_Expression_ExtensionReference class
161
162 * 1.23.1 (2015-11-05)
163
164  * fixed some exception messages which triggered PHP warnings
165  * fixed BC on Twig_Test_NodeTestCase
166
167 * 1.23.0 (2015-10-29)
168
169  * deprecated the possibility to override an extension by registering another one with the same name
170  * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC)
171  * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC)
172  * deprecated Twig_Environment::computeAlternatives()
173
174 * 1.22.3 (2015-10-13)
175
176  * fixed regression when using null as a cache strategy
177  * improved performance when checking template freshness
178  * fixed warnings when loaded templates do not exist
179  * fixed template class name generation to prevent possible collisions
180  * fixed logic for custom escapers to call them even on integers and null values
181  * changed template cache names to take into account the Twig C extension
182
183 * 1.22.2 (2015-09-22)
184
185  * fixed a race condition in template loading
186
187 * 1.22.1 (2015-09-15)
188
189  * fixed regression in template_from_string
190
191 * 1.22.0 (2015-09-13)
192
193  * made Twig_Test_IntegrationTestCase more flexible
194  * added an option to force PHP bytecode invalidation when writing a compiled template into the cache
195  * fixed the profiler duration for the root node
196  * changed template cache names to take into account enabled extensions
197  * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(),
198    Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix()
199  * added a way to override the filesystem template cache system
200  * added a way to get the original template source from Twig_Template
201
202 * 1.21.2 (2015-09-09)
203
204  * fixed variable names for the deprecation triggering code
205  * fixed escaping strategy detection based on filename
206  * added Traversable support for replace, merge, and sort
207  * deprecated support for character by character replacement for the "replace" filter
208
209 * 1.21.1 (2015-08-26)
210
211  * fixed regression when using the deprecated Twig_Test_* classes
212
213 * 1.21.0 (2015-08-24)
214
215  * added deprecation notices for deprecated features
216  * added a deprecation "framework" for filters/functions/tests and test fixtures
217
218 * 1.20.0 (2015-08-12)
219
220  * forbid access to the Twig environment from templates and internal parts of Twig_Template
221  * fixed limited RCEs when in sandbox mode
222  * deprecated Twig_Template::getEnvironment()
223  * deprecated the _self variable for usage outside of the from and import tags
224  * added Twig_BaseNodeVisitor to ease the compatibility of node visitors 
225    between 1.x and 2.x
226
227 * 1.19.0 (2015-07-31)
228
229  * fixed wrong error message when including an undefined template in a child template
230  * added support for variadic filters, functions, and tests
231  * added support for extra positional arguments in macros
232  * added ignore_missing flag to the source function
233  * fixed batch filter with zero items
234  * deprecated Twig_Environment::clearTemplateCache()
235  * fixed sandbox disabling when using the include function
236
237 * 1.18.2 (2015-06-06)
238
239  * fixed template/line guessing in exceptions for nested templates
240  * optimized the number of inodes and the size of realpath cache when using the cache
241
242 * 1.18.1 (2015-04-19)
243
244  * fixed memory leaks in the C extension
245  * deprecated Twig_Loader_String
246  * fixed the slice filter when used with a SimpleXMLElement object
247  * fixed filesystem loader when trying to load non-files (like directories)
248
249 * 1.18.0 (2015-01-25)
250
251  * fixed some error messages where the line was wrong (unknown variables or argument names)
252  * added a new way to customize the main Module node (via empty nodes)
253  * added Twig_Environment::createTemplate() to create a template from a string
254  * added a profiler
255  * fixed filesystem loader cache when different file paths are used for the same template
256
257 * 1.17.0 (2015-01-14)
258
259  * added a 'filename' autoescaping strategy, which dynamically chooses the
260    autoescaping strategy for a template based on template file extension.
261
262 * 1.16.3 (2014-12-25)
263
264  * fixed regression for dynamic parent templates
265  * fixed cache management with statcache
266  * fixed a regression in the slice filter
267
268 * 1.16.2 (2014-10-17)
269
270  * fixed timezone on dates as strings
271  * fixed 2-words test names when a custom node class is not used
272  * fixed macros when using an argument named like a PHP super global (like GET or POST)
273  * fixed date_modify when working with DateTimeImmutable
274  * optimized for loops
275  * fixed multi-byte characters handling in the split filter
276  * fixed a regression in the in operator
277  * fixed a regression in the slice filter
278
279 * 1.16.1 (2014-10-10)
280
281  * improved error reporting in a sandboxed template
282  * fixed missing error file/line information under certain circumstances
283  * fixed wrong error line number in some error messages
284  * fixed the in operator to use strict comparisons
285  * sped up the slice filter
286  * fixed for mb function overload mb_substr acting different
287  * fixed the attribute() function when passing a variable for the arguments
288
289 * 1.16.0 (2014-07-05)
290
291  * changed url_encode to always encode according to RFC 3986
292  * fixed inheritance in a 'use'-hierarchy
293  * removed the __toString policy check when the sandbox is disabled
294  * fixed recursively calling blocks in templates with inheritance
295
296 * 1.15.1 (2014-02-13)
297
298  * fixed the conversion of the special '0000-00-00 00:00' date
299  * added an error message when trying to import an undefined block from a trait
300  * fixed a C extension crash when accessing defined but uninitialized property.
301
302 * 1.15.0 (2013-12-06)
303
304  * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException
305  * added min and max functions
306  * added the round filter
307  * fixed a bug that prevented the optimizers to be enabled/disabled selectively
308  * fixed first and last filters for UTF-8 strings
309  * added a source function to include the content of a template without rendering it
310  * fixed the C extension sandbox behavior when get or set is prepend to method name
311
312 * 1.14.2 (2013-10-30)
313
314  * fixed error filename/line when an error occurs in an included file
315  * allowed operators that contain whitespaces to have more than one whitespace
316  * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by")
317
318 * 1.14.1 (2013-10-15)
319
320  * made it possible to use named operators as variables
321  * fixed the possibility to have a variable named 'matches'
322  * added support for PHP 5.5 DateTimeInterface
323
324 * 1.14.0 (2013-10-03)
325
326  * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
327  * added new operators: ends with, starts with, and matches
328  * fixed some compatibility issues with HHVM
329  * added a way to add custom escaping strategies
330  * fixed the C extension compilation on Windows
331  * fixed the batch filter when using a fill argument with an exact match of elements to batch
332  * fixed the filesystem loader cache when a template name exists in several namespaces
333  * fixed template_from_string when the template includes or extends other ones
334  * fixed a crash of the C extension on an edge case
335
336 * 1.13.2 (2013-08-03)
337
338  * fixed the error line number for an error occurs in and embedded template
339  * fixed crashes of the C extension on some edge cases
340
341 * 1.13.1 (2013-06-06)
342
343  * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
344  * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
345  * adjusted backtrace call to reduce memory usage when an error occurs
346  * added support for object instances as the second argument of the constant test
347  * fixed the include function when used in an assignment
348
349 * 1.13.0 (2013-05-10)
350
351  * fixed getting a numeric-like item on a variable ('09' for instance)
352  * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access:
353    `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`)
354  * made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
355  * changed â˜ƒ to Â§ in tests
356  * enforced usage of named arguments after positional ones
357
358 * 1.12.3 (2013-04-08)
359
360  * fixed a security issue in the filesystem loader where it was possible to include a template one
361    level above the configured path
362  * fixed fatal error that should be an exception when adding a filter/function/test too late
363  * added a batch filter
364  * added support for encoding an array as query string in the url_encode filter
365
366 * 1.12.2 (2013-02-09)
367
368  * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00)
369  * fixed globals when getGlobals is called early on
370  * added the first and last filter
371
372 * 1.12.1 (2013-01-15)
373
374  * added support for object instances as the second argument of the constant function
375  * relaxed globals management to avoid a BC break
376  * added support for {{ some_string[:2] }}
377
378 * 1.12.0 (2013-01-08)
379
380  * added verbatim as an alias for the raw tag to avoid confusion with the raw filter
381  * fixed registration of tests and functions as anonymous functions
382  * fixed globals management
383
384 * 1.12.0-RC1 (2012-12-29)
385
386  * added an include function (does the same as the include tag but in a more flexible way)
387  * added the ability to use any PHP callable to define filters, functions, and tests
388  * added a syntax error when using a loop variable that is not defined
389  * added the ability to set default values for macro arguments
390  * added support for named arguments for filters, tests, and functions
391  * moved filters/functions/tests syntax errors to the parser
392  * added support for extended ternary operator syntaxes
393
394 * 1.11.1 (2012-11-11)
395
396  * fixed debug info line numbering (was off by 2)
397  * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1)
398  * optimized variable access on PHP 5.4
399  * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX)
400
401 * 1.11.0 (2012-11-07)
402
403  * fixed macro compilation when a variable name is a PHP reserved keyword
404  * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
405  * fixed bitwise operator precedences
406  * added the template_from_string function
407  * fixed default timezone usage for the date function
408  * optimized the way Twig exceptions are managed (to make them faster)
409  * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster)
410
411 * 1.10.3 (2012-10-19)
412
413  * fixed wrong template location in some error messages
414  * reverted a BC break introduced in 1.10.2
415  * added a split filter
416
417 * 1.10.2 (2012-10-15)
418
419  * fixed macro calls on PHP 5.4
420
421 * 1.10.1 (2012-10-15)
422
423  * made a speed optimization to macro calls when imported via the "import" tag
424  * fixed C extension compilation on Windows
425  * fixed a segfault in the C extension when using DateTime objects
426
427 * 1.10.0 (2012-09-28)
428
429  * extracted functional tests framework to make it reusable for third-party extensions
430  * added namespaced templates support in Twig_Loader_Filesystem
431  * added Twig_Loader_Filesystem::prependPath()
432  * fixed an error when a token parser pass a closure as a test to the subparse() method
433
434 * 1.9.2 (2012-08-25)
435
436  * fixed the in operator for objects that contain circular references
437  * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface
438
439 * 1.9.1 (2012-07-22)
440
441  * optimized macro calls when auto-escaping is on
442  * fixed wrong parent class for Twig_Function_Node
443  * made Twig_Loader_Chain more explicit about problems
444
445 * 1.9.0 (2012-07-13)
446
447  * made the parsing independent of the template loaders
448  * fixed exception trace when an error occurs when rendering a child template
449  * added escaping strategies for CSS, URL, and HTML attributes
450  * fixed nested embed tag calls
451  * added the date_modify filter
452
453 * 1.8.3 (2012-06-17)
454
455  * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash
456  * fixed escaping when a project defines a function named html or js
457  * fixed chmod mode to apply the umask correctly
458
459 * 1.8.2 (2012-05-30)
460
461  * added the abs filter
462  * fixed a regression when using a number in template attributes
463  * fixed compiler when mbstring.func_overload is set to 2
464  * fixed DateTimeZone support in date filter
465
466 * 1.8.1 (2012-05-17)
467
468  * fixed a regression when dealing with SimpleXMLElement instances in templates
469  * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini
470  * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ)
471
472 * 1.8.0 (2012-05-08)
473
474  * enforced interface when adding tests, filters, functions, and node visitors from extensions
475  * fixed a side-effect of the date filter where the timezone might be changed
476  * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
477  * added a way to dynamically change the auto-escaping strategy according to the template "filename"
478  * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html)
479  * added an embed tag
480
481 * 1.7.0 (2012-04-24)
482
483  * fixed a PHP warning when using CIFS
484  * fixed template line number in some exceptions
485  * added an iterable test
486  * added an error when defining two blocks with the same name in a template
487  * added the preserves_safety option for filters
488  * fixed a PHP notice when trying to access a key on a non-object/array variable
489  * enhanced error reporting when the template file is an instance of SplFileInfo
490  * added Twig_Environment::mergeGlobals()
491  * added compilation checks to avoid misuses of the sandbox tag
492  * fixed filesystem loader freshness logic for high traffic websites
493  * fixed random function when charset is null
494
495 * 1.6.5 (2012-04-11)
496
497  * fixed a regression when a template only extends another one without defining any blocks
498
499 * 1.6.4 (2012-04-02)
500
501  * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3
502  * fixed performance when compiling large files
503  * optimized parent template creation when the template does not use dynamic inheritance
504
505 * 1.6.3 (2012-03-22)
506
507  * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension
508  * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot
509  * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate
510
511 * 1.6.2 (2012-03-18)
512
513  * fixed sandbox mode when used with inheritance
514  * added preserveKeys support for the slice filter
515  * fixed the date filter when a DateTime instance is passed with a specific timezone
516  * added a trim filter
517
518 * 1.6.1 (2012-02-29)
519
520  * fixed Twig C extension
521  * removed the creation of Twig_Markup instances when not needed
522  * added a way to set the default global timezone for dates
523  * fixed the slice filter on strings when the length is not specified
524  * fixed the creation of the cache directory in case of a race condition
525
526 * 1.6.0 (2012-02-04)
527
528  * fixed raw blocks when used with the whitespace trim option
529  * made a speed optimization to macro calls when imported via the "from" tag
530  * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added
531  * fixed the attribute function when passing arguments
532  * added slice notation support for the [] operator (syntactic sugar for the slice operator)
533  * added a slice filter
534  * added string support for the reverse filter
535  * fixed the empty test and the length filter for Twig_Markup instances
536  * added a date function to ease date comparison
537  * fixed unary operators precedence
538  * added recursive parsing support in the parser
539  * added string and integer handling for the random function
540
541 * 1.5.1 (2012-01-05)
542
543  * fixed a regression when parsing strings
544
545 * 1.5.0 (2012-01-04)
546
547  * added Traversable objects support for the join filter
548
549 * 1.5.0-RC2 (2011-12-30)
550
551  * added a way to set the default global date interval format
552  * fixed the date filter for DateInterval instances (setTimezone() does not exist for them)
553  * refactored Twig_Template::display() to ease its extension
554  * added a number_format filter
555
556 * 1.5.0-RC1 (2011-12-26)
557
558  * removed the need to quote hash keys
559  * allowed hash keys to be any expression
560  * added a do tag
561  * added a flush tag
562  * added support for dynamically named filters and functions
563  * added a dump function to help debugging templates
564  * added a nl2br filter
565  * added a random function
566  * added a way to change the default format for the date filter
567  * fixed the lexer when an operator ending with a letter ends a line
568  * added string interpolation support
569  * enhanced exceptions for unknown filters, functions, tests, and tags
570
571 * 1.4.0 (2011-12-07)
572
573  * fixed lexer when using big numbers (> PHP_INT_MAX)
574  * added missing preserveKeys argument to the reverse filter
575  * fixed macros containing filter tag calls
576
577 * 1.4.0-RC2 (2011-11-27)
578
579  * removed usage of Reflection in Twig_Template::getAttribute()
580  * added a C extension that can optionally replace Twig_Template::getAttribute()
581  * added negative timestamp support to the date filter
582
583 * 1.4.0-RC1 (2011-11-20)
584
585  * optimized variable access when using PHP 5.4
586  * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby
587  * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders
588  * added Twig_Function_Node to allow more complex functions to have their own Node class
589  * added Twig_Filter_Node to allow more complex filters to have their own Node class
590  * added Twig_Test_Node to allow more complex tests to have their own Node class
591  * added a better error message when a template is empty but contain a BOM
592  * fixed "in" operator for empty strings
593  * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option)
594  * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order)
595  * added Twig_Environment::display()
596  * made the escape filter smarter when the encoding is not supported by PHP
597  * added a convert_encoding filter
598  * moved all node manipulations outside the compile() Node method
599  * made several speed optimizations
600
601 * 1.3.0 (2011-10-08)
602
603 no changes
604
605 * 1.3.0-RC1 (2011-10-04)
606
607  * added an optimization for the parent() function
608  * added cache reloading when auto_reload is true and an extension has been modified
609  * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup)
610  * allowed empty templates to be used as traits
611  * added traits support for the "parent" function
612
613 * 1.2.0 (2011-09-13)
614
615 no changes
616
617 * 1.2.0-RC1 (2011-09-10)
618
619  * enhanced the exception when a tag remains unclosed
620  * added support for empty Countable objects for the "empty" test
621  * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions)
622  * added better support for encoding problems when escaping a string (available as of PHP 5.4)
623  * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %})
624  * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %})
625  * added support for bitwise operators in expressions
626  * added the "attribute" function to allow getting dynamic attributes on variables
627  * added Twig_Loader_Chain
628  * added Twig_Loader_Array::setTemplate()
629  * added an optimization for the set tag when used to capture a large chunk of static text
630  * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros)
631  * removed the possibility to use the "extends" tag from a block
632  * added "if" modifier support to "for" loops
633
634 * 1.1.2 (2011-07-30)
635
636  * fixed json_encode filter on PHP 5.2
637  * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }})
638  * fixed inheritance when using conditional parents
639  * fixed compilation of templates when the body of a child template is not empty
640  * fixed output when a macro throws an exception
641  * fixed a parsing problem when a large chunk of text is enclosed in a comment tag
642  * added PHPDoc for all Token parsers and Core extension functions
643
644 * 1.1.1 (2011-07-17)
645
646  * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls)
647  * made some performance improvement for some edge cases
648
649 * 1.1.0 (2011-06-28)
650
651  * fixed json_encode filter
652
653 * 1.1.0-RC3 (2011-06-24)
654
655  * fixed method case-sensitivity when using the sandbox mode
656  * added timezone support for the date filter
657  * fixed possible security problems with NUL bytes
658
659 * 1.1.0-RC2 (2011-06-16)
660
661  * added an exception when the template passed to "use" is not a string
662  * made 'a.b is defined' not throw an exception if a is not defined (in strict mode)
663  * added {% line \d+ %} directive
664
665 * 1.1.0-RC1 (2011-05-28)
666
667 Flush your cache after upgrading.
668
669  * fixed date filter when using a timestamp
670  * fixed the defined test for some cases
671  * fixed a parsing problem when a large chunk of text is enclosed in a raw tag
672  * added support for horizontal reuse of template blocks (see docs for more information)
673  * added whitespace control modifier to all tags (see docs for more information)
674  * added null as an alias for none (the null test is also an alias for the none test now)
675  * made TRUE, FALSE, NONE equivalent to their lowercase counterparts
676  * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line
677  * moved display() method to Twig_Template (generated templates should now use doDisplay() instead)
678
679 * 1.0.0 (2011-03-27)
680
681  * fixed output when using mbstring
682  * fixed duplicate call of methods when using the sandbox
683  * made the charset configurable for the escape filter
684
685 * 1.0.0-RC2 (2011-02-21)
686
687  * changed the way {% set %} works when capturing (the content is now marked as safe)
688  * added support for macro name in the endmacro tag
689  * make Twig_Error compatible with PHP 5.3.0 >
690  * fixed an infinite loop on some Windows configurations
691  * fixed the "length" filter for numbers
692  * fixed Template::getAttribute() as properties in PHP are case sensitive
693  * removed coupling between Twig_Node and Twig_Template
694  * fixed the ternary operator precedence rule
695
696 * 1.0.0-RC1 (2011-01-09)
697
698 Backward incompatibilities:
699
700  * the "items" filter, which has been deprecated for quite a long time now, has been removed
701  * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10)
702  * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }}
703  * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }}
704  * the "for" tag does not support "joined by" anymore
705  * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off")
706  * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %})
707  * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %})
708  * removed the grammar and simple token parser (moved to the Twig Extensions repository)
709
710 Changes:
711
712  * added "needs_context" option for filters and functions (the context is then passed as a first argument)
713  * added global variables support
714  * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode)
715  * added the "from" tag to import macros as functions
716  * added support for functions (a function is just syntactic sugar for a getAttribute() call)
717  * made macros callable when sandbox mode is enabled
718  * added an exception when a macro uses a reserved name
719  * the "default" filter now uses the "empty" test instead of just checking for null
720  * added the "empty" test
721
722 * 0.9.10 (2010-12-16)
723
724 Backward incompatibilities:
725
726  * The Escaper extension is enabled by default, which means that all displayed
727    variables are now automatically escaped. You can revert to the previous
728    behavior by removing the extension via $env->removeExtension('escaper')
729    or just set the 'autoescape' option to 'false'.
730  * removed the "without loop" attribute for the "for" tag (not needed anymore
731    as the Optimizer take care of that for most cases)
732  * arrays and hashes have now a different syntax
733      * arrays keep the same syntax with square brackets: [1, 2]
734      * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"})
735      * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1})
736  * the i18n extension is now part of the Twig Extensions repository
737
738 Changes:
739
740  * added the merge filter
741  * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead
742  * fixed usage of operators as method names (like is, in, and not)
743  * changed the order of execution for node visitors
744  * fixed default() filter behavior when used with strict_variables set to on
745  * fixed filesystem loader compatibility with PHAR files
746  * enhanced error messages when an unexpected token is parsed in an expression
747  * fixed filename not being added to syntax error messages
748  * added the autoescape option to enable/disable autoescaping
749  * removed the newline after a comment (mimics PHP behavior)
750  * added a syntax error exception when parent block is used on a template that does not extend another one
751  * made the Escaper extension enabled by default
752  * fixed sandbox extension when used with auto output escaping
753  * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved)
754  * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters)
755  * added priority to node visitors
756
757 * 0.9.9 (2010-11-28)
758
759 Backward incompatibilities:
760  * the self special variable has been renamed to _self
761  * the odd and even filters are now tests:
762      {{ foo|odd }} must now be written {{ foo is odd }}
763  * the "safe" filter has been renamed to "raw"
764  * in Node classes,
765         sub-nodes are now accessed via getNode() (instead of property access)
766         attributes via getAttribute() (instead of array access)
767  * the urlencode filter had been renamed to url_encode
768  * the include tag now merges the passed variables with the current context by default
769    (the old behavior is still possible by adding the "only" keyword)
770  * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime)
771  * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead)
772  * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }})
773
774 Changes:
775  * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template
776  * changed trans tag to accept any variable for the plural count
777  * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements)
778  * added the ** (power) operator
779  * changed the algorithm used for parsing expressions
780  * added the spaceless tag
781  * removed trim_blocks option
782  * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar())
783  * changed all exceptions to extend Twig_Error
784  * fixed unary expressions ({{ not(1 or 0) }})
785  * fixed child templates (with an extend tag) that uses one or more imports
786  * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }})
787  * escaping has been rewritten
788  * the implementation of template inheritance has been rewritten
789    (blocks can now be called individually and still work with inheritance)
790  * fixed error handling for if tag when a syntax error occurs within a subparse process
791  * added a way to implement custom logic for resolving token parsers given a tag name
792  * fixed js escaper to be stricter (now uses a whilelist-based js escaper)
793  * added the following filers: "constant", "trans", "replace", "json_encode"
794  * added a "constant" test
795  * fixed objects with __toString() not being autoescaped
796  * fixed subscript expressions when calling __call() (methods now keep the case)
797  * added "test" feature (accessible via the "is" operator)
798  * removed the debug tag (should be done in an extension)
799  * fixed trans tag when no vars are used in plural form
800  * fixed race condition when writing template cache
801  * added the special _charset variable to reference the current charset
802  * added the special _context variable to reference the current context
803  * renamed self to _self (to avoid conflict)
804  * fixed Twig_Template::getAttribute() for protected properties
805
806 * 0.9.8 (2010-06-28)
807
808 Backward incompatibilities:
809  * the trans tag plural count is now attached to the plural tag:
810     old: `{% trans count %}...{% plural %}...{% endtrans %}`
811     new: `{% trans %}...{% plural count %}...{% endtrans %}`
812
813  * added a way to translate strings coming from a variable ({% trans var %})
814  * fixed trans tag when used with the Escaper extension
815  * fixed default cache umask
816  * removed Twig_Template instances from the debug tag output
817  * fixed objects with __isset() defined
818  * fixed set tag when used with a capture
819  * fixed type hinting for Twig_Environment::addFilter() method
820
821 * 0.9.7 (2010-06-12)
822
823 Backward incompatibilities:
824  * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %})
825  * removed the sandboxed attribute of the include tag (use the new sandbox tag instead)
826  * refactored the Node system (if you have custom nodes, you will have to update them to use the new API)
827
828  * added self as a special variable that refers to the current template (useful for importing macros from the current template)
829  * added Twig_Template instance support to the include tag
830  * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %})
831  * added a grammar sub-framework to ease the creation of custom tags
832  * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface)
833  * removed the Twig_Resource::resolveMissingFilter() method
834  * fixed the filter tag which did not apply filtering to included files
835  * added a bunch of unit tests
836  * added a bunch of phpdoc
837  * added a sandbox tag in the sandbox extension
838  * changed the date filter to support any date format supported by DateTime
839  * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default)
840  * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor
841  * changed the cache option to only accepts an explicit path to a cache directory or false
842  * added a way to add token parsers, filters, and visitors without creating an extension
843  * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface
844  * changed the generated code to match the new coding standards
845  * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }})
846  * added an exception when a child template has a non-empty body (as it is always ignored when rendering)
847
848 * 0.9.6 (2010-05-12)
849
850  * fixed variables defined outside a loop and for which the value changes in a for loop
851  * fixed the test suite for PHP 5.2 and older versions of PHPUnit
852  * added support for __call() in expression resolution
853  * fixed node visiting for macros (macros are now visited by visitors as any other node)
854  * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now)
855  * added the cycle filter
856  * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII
857  * added a long-syntax for the set tag ({% set foo %}...{% endset %})
858  * unit tests are now powered by PHPUnit
859  * added support for gettext via the `i18n` extension
860  * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values
861  * added a more useful exception if an if tag is not closed properly
862  * added support for escaping strategy in the autoescape tag
863  * fixed lexer when a template has a big chunk of text between/in a block
864
865 * 0.9.5 (2010-01-20)
866
867 As for any new release, don't forget to remove all cached templates after
868 upgrading.
869
870 If you have defined custom filters, you MUST upgrade them for this release. To
871 upgrade, replace "array" with "new Twig_Filter_Function", and replace the
872 environment constant by the "needs_environment" option:
873
874   // before
875   'even'   => array('twig_is_even_filter', false),
876   'escape' => array('twig_escape_filter', true),
877
878   // after
879   'even'   => new Twig_Filter_Function('twig_is_even_filter'),
880   'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)),
881
882 If you have created NodeTransformer classes, you will need to upgrade them to
883 the new interface (please note that the interface is not yet considered
884 stable).
885
886  * fixed list nodes that did not extend the Twig_NodeListInterface
887  * added the "without loop" option to the for tag (it disables the generation of the loop variable)
888  * refactored node transformers to node visitors
889  * fixed automatic-escaping for blocks
890  * added a way to specify variables to pass to an included template
891  * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules)
892  * improved the filter system to allow object methods to be used as filters
893  * changed the Array and String loaders to actually make use of the cache mechanism
894  * included the default filter function definitions in the extension class files directly (Core, Escaper)
895  * added the // operator (like the floor() PHP function)
896  * added the .. operator (as a syntactic sugar for the range filter when the step is 1)
897  * added the in operator (as a syntactic sugar for the in filter)
898  * added the following filters in the Core extension: in, range
899  * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes)
900  * enhanced some error messages to provide better feedback in case of parsing errors
901
902 * 0.9.4 (2009-12-02)
903
904 If you have custom loaders, you MUST upgrade them for this release: The
905 Twig_Loader base class has been removed, and the Twig_LoaderInterface has also
906 been changed (see the source code for more information or the documentation).
907
908  * added support for DateTime instances for the date filter
909  * fixed loop.last when the array only has one item
910  * made it possible to insert newlines in tag and variable blocks
911  * fixed a bug when a literal '\n' were present in a template text
912  * fixed bug when the filename of a template contains */
913  * refactored loaders
914
915 * 0.9.3 (2009-11-11)
916
917 This release is NOT backward compatible with the previous releases.
918
919   The loaders do not take the cache and autoReload arguments anymore. Instead,
920   the Twig_Environment class has two new options: cache and auto_reload.
921   Upgrading your code means changing this kind of code:
922
923       $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true);
924       $twig = new Twig_Environment($loader);
925
926   to something like this:
927
928       $loader = new Twig_Loader_Filesystem('/path/to/templates');
929       $twig = new Twig_Environment($loader, array(
930         'cache' => '/path/to/compilation_cache',
931         'auto_reload' => true,
932       ));
933
934  * deprecated the "items" filter as it is not needed anymore
935  * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader
936  * optimized template loading speed
937  * removed output when an error occurs in a template and render() is used
938  * made major speed improvements for loops (up to 300% on even the smallest loops)
939  * added properties as part of the sandbox mode
940  * added public properties support (obj.item can now be the item property on the obj object)
941  * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} )
942  * fixed bug when \ was used in HTML
943
944 * 0.9.2 (2009-10-29)
945
946  * made some speed optimizations
947  * changed the cache extension to .php
948  * added a js escaping strategy
949  * added support for short block tag
950  * changed the filter tag to allow chained filters
951  * made lexer more flexible as you can now change the default delimiters
952  * added set tag
953  * changed default directory permission when cache dir does not exist (more secure)
954  * added macro support
955  * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance
956  * made Twig_Autoloader::autoload() a static method
957  * avoid writing template file if an error occurs
958  * added $ escaping when outputting raw strings
959  * enhanced some error messages to ease debugging
960  * fixed empty cache files when the template contains an error
961
962 * 0.9.1 (2009-10-14)
963
964   * fixed a bug in PHP 5.2.6
965   * fixed numbers with one than one decimal
966   * added support for method calls with arguments ({{ foo.bar('a', 43) }})
967   * made small speed optimizations
968   * made minor tweaks to allow better extensibility and flexibility
969
970 * 0.9.0 (2009-10-12)
971
972  * Initial release