-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fabpot
commented
Nov 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 |
👍 Status: reviewed |
This is not fool proof though, what about an approach such as here? |
@iltar Can you explain in which circumstances it would not work? |
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. |
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 in b376d92
|
@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. |
👍 |
1 similar comment
👍 |
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
@@ -66,6 +66,7 @@ public function process(ContainerBuilder $container) | |||
|
|||
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 ? Should twig.loader.filesystem
configure it too ?
This causes problems as soon as you are a bit paranoid with open_basedir or deliver a project without the composer.json file: #22149 |