Skip to content

[TwigBundle] made Twig cache independent of the project root directory #20285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2016

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Oct 23, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no (except if people configured relative paths instead of absolute ones, but this was not supported in earlier versions of Twig)
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

This makes Twig cache keys independent of the project root directory, thanks to Twig 1.27.

It cannot be merged in 2.7 as a bug fix as people might have used relative paths for some Twig paths (no officially supported by Twig anyway), which would have resolved to getcwd() before, but will now be interpreted as being relative to %kernel.root_dir% now.

@fabpot fabpot merged commit dc38af3 into symfony:master Oct 24, 2016
fabpot added a commit that referenced this pull request Oct 24, 2016
…t root directory (fabpot)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[TwigBundle] made Twig cache independent of the project root directory

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (except if people configured relative paths instead of absolute ones, but this was not supported in earlier versions of Twig)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This makes Twig cache keys independent of the project root directory, thanks to Twig 1.27.

It cannot be merged in 2.7 as a bug fix as people might have used relative paths for some Twig paths (no officially supported by Twig anyway), which would have resolved to `getcwd()` before, but will now be interpreted as being relative to `%kernel.root_dir%` now.

Commits
-------

dc38af3 [TwigBundle] made Twig cache independent of the project root directory
@fabpot fabpot deleted the twig-relative-paths branch October 24, 2016 21:39
@fabpot fabpot mentioned this pull request Oct 27, 2016
@stof
Copy link
Member

stof commented Oct 31, 2016

kernel.root_dir is not the root of the project, which means that any template being inside a bundle will still use the absolute path to build the cache key. So this does not look like a good implementation to me

@fabpot
Copy link
Member Author

fabpot commented Nov 6, 2016

@stof see #20428

fabpot added a commit that referenced this pull request Nov 9, 2016
This PR was merged into the 3.2-dev branch.

Discussion
----------

[TwigBundle] fixed template root path

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | see #20285
| License       | MIT
| Doc PR        | n/a

Commits
-------

526b8a0 [TwigBundle] fixed template root path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants