Twig 1.22 is full of great features.
First, the template cache has been extracted to its own class to ease integration with specific needs (like Drupal). Note that you should probably not use it to store the compiled template classes elsewhere than the filesystem though. This new feature comes with some deprecations in Twig_Environment
(clearCacheFiles()
, getCacheFilename()
, writeCacheFile()
, and getTemplateClassPrefix()
).
Other changes includes the following:
- made Twig_Test_IntegrationTestCase more flexible
- added an option to force PHP bytecode invalidation when writing a compiled template into the cache
- fixed the profiler duration for the root node
- changed template cache names to take into account enabled extensions
- deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(), Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix()
- added a way to override the filesystem template cache system
- added a way to get the original template source from Twig_Template