Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[TwigBundle] fixed template root path#20428
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fabpot commentedNov 6, 2016
| 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 |
javiereguiluz commentedNov 7, 2016
👍 Status: reviewed |
linaori commentedNov 7, 2016
This is not fool proof though, what about an approach such as here? |
fabpot commentedNov 7, 2016
@iltar Can you explain in which circumstances it would not work? |
linaori commentedNov 8, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If I understand this PR correctly, it will traverse down until it find a There are just some cases that make this a bit difficult to ensure this would work. |
nicolas-grekas commentedNov 8, 2016
I suggest using the common prefix between the vendor dir and the kernel.root_dir, as done in symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php Lines 56 to 66 inb376d92
|
fabpot commentedNov 9, 2016
@nicolas-grekas I prefer my strategy. Storing the @iltar I don't want to support the edge cases you mention, they are non standard and I don't see why it would be a good idea in the first place. Supporting bad practices is not a goal. |
nicolas-grekas commentedNov 9, 2016
👍 |
1 similar comment
Tobion commentedNov 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/aCommits-------526b8a0 [TwigBundle] fixed template root path
| if (!$container->has('templating')) { | ||
| $loader =$container->getDefinition('twig.loader.native_filesystem'); | ||
| $loader->replaceArgument(1,$this->getComposerRootDir($container->getParameter('kernel.root_dir'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
why is it configured only for when the templating componnet is disabled ? Shouldtwig.loader.filesystem configure it too ?
pounard commentedMar 24, 2017
This causes problems as soon as you are a bit paranoid with open_basedir or deliver a project without the composer.json file:#22149 |