This PR was merged into the 1.x branch.
Discussion
----------
make cache per user (on linux)
Just because I hate having failed test when I run test once on 1 account, then once on another account ;)
Commits
-------
da5cac6 make cache per user (on linux)
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_ExtensionInterface::initRuntime()
I'm working on splitting Twig extensions into 2 different phases: compilation and runtime. The goal is to avoid having to load the runtime environment of an extension when compiling templates. That also opens the way to be able to lazy-load Twig extensions.
While working on the split, I realized that the `initRuntime()` method on `Twig_ExtensionInterface` is not needed anymore. It was added at a time `needs_environment` did not exist and was a way to keep the environment around for custom filters/tests/functions. But nowadays, that's not needed anymore. I did a quick search on Github, and most of the implementation I found just store the environment in a local property, which is not needed anymore. So, I propose to deprecate it in 1.x and remove it in 2.0.
Commits
-------
9774f4f deprecated Twig_ExtensionInterface::initRuntime()
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_Environment::computeAlternatives()
Commits
-------
d0a5ef8 deprecated Twig_Environment::computeAlternatives()
This PR was merged into the 1.x branch.
Discussion
----------
made the tests semantically more correct
Calling `initRuntime()` is just a side-effect of loading a template.
Commits
-------
f839ad3 made the tests semantically more correct
When the extension class is not defined in a file but in eval'd code
we cannot assume ReflectionObject::getFileName will return
a valid file path.
https://bugs.php.net/bug.php?id=63901
This PR was squashed before being merged into the 1.x branch (closes#1846).
Discussion
----------
Add test coverage for auto_reload
Fixes#1841
Commits
-------
1769f84 Add test coverage for auto_reload
This PR was merged into the 1.x branch.
Discussion
----------
Add unit tests for filesystem cache
Fixes#1842
Commits
-------
40555fc Add test coverage for Twig_Cache_Filesystem
This PR was squashed before being merged into the 1.x branch (closes#1806).
Discussion
----------
More flexible integration test
replaces https://github.com/twigphp/Twig/pull/1805 as a 1.x version
Commits
-------
3f779f6 More flexible integration test
This PR was merged into the 1.x branch.
Discussion
----------
changed the arguments of generateKey
We now pass the template name and the template class, which seems much better from a UX standpoint.
Passing the prefix was really just a hack and an implementation leak to be able to determine the variable part of the class name and generate sub-directories for templates. Now, we generate the cache key by taking the last characters instead of the first ones, to avoid the need for the class prefix.
That should also make Drupal happy :)
Commits
-------
c2e75ff changed the arguments of generateKey
0157315 deprecated Twig_Environment::getTemplateClassPrefix
This PR was merged into the 1.x branch.
Discussion
----------
Add $template->getSource()
Now that we have the source inlined, we should provide a way to get it. This also make it possible to feature-test if the source is available for backward/forward compat.
Commits
-------
de86850 Add $template->getSource()
This PR was merged into the 1.x branch.
Discussion
----------
Traversable support for 'replace', 'merge' and 'sort'
Add traversable support to:
* replace
* merge
* sort
Other changes:
* Removes some not need checks
* ~~Make unit test skip if it cannot write to cache because of the user running the test~~
* Tests added for traversable support
* Doc updates
Deprecating:
I think the undocumented (and multibyte not supported) use of `replace(string, string)` can be removed in Twig 2.0.
Adding MB support and documentation of the feature was turned down (https://github.com/twigphp/Twig/pull/1618)
However removing it is a BC break (https://github.com/twigphp/Twig/pull/1445#issuecomment-48746926)
Commits
-------
2a17303 Mark test skipped if cannot write to cache directory.
This also fixes the logic detecting reserved macro names to account for
the fact that they are compiled prefixed with get() since a very long
time and the logic preventing conflicts was broken.