mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
87e27b6a26fd477a407bf98b4c7af04455437f6a
This PR was merged into the 1.x branch. Discussion ---------- Extracted the filesystem cache to its own class Twig caches the compiled PHP classes on the filesystem. This is **always** the best strategy as it allows Twig to automatically benefit from PHP opcache/APC. But overriding how the classes are stored on the filesystem is difficult with the current way, so this PR proposes to extract this logic to its own class (that should allow Drupal to stop copy/pasting some Twig code and accessing private code - see #1811). This PR also unifies the no-cache feature by extracting it to its own class as well. BC is kept and the `false` and `$dir` caching strategies are still supported. The `Twig_Cache_Interface` can be used to create other cache classes, but that's not documented and should only be used with extreme care (performance-wise). It means that Twig itself will **never** ship with other implementations like Memcache, Redis, whatever storage is hype nowadays. This should fix #1421 (this PR builds on top of it), #1573, #1415, #741, #728. Commits -------cacfb06added a cache interface for templates04cc7e4Implemented filesystem cache, one and only (see #1415)
Twig, the flexible, fast, and secure template language for PHP ============================================================== Twig is a template language for PHP, released under the new BSD license (code and documentation). Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. More Information ---------------- Read the `documentation`_ for more information. .. _documentation: http://twig.sensiolabs.org/documentation
Description
Languages
PHP
99.9%