Fabien Potencier 87e27b6a26 feature #1812 Extracted the filesystem cache to its own class (andrewtch, fabpot)
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
-------

cacfb06 added a cache interface for templates
04cc7e4 Implemented filesystem cache, one and only (see #1415)
2015-09-11 16:41:19 +02:00
2015-09-11 16:24:57 +02:00
2015-01-20 03:31:04 +01:00
2013-11-11 20:04:42 +01:00

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
Languages
PHP 99.9%