File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
src/Symfony/Bundle/TwigBundle
DependencyInjection/Compiler Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,13 @@ public function process(ContainerBuilder $container)
6464 $ container ->getDefinition ('twig.extension.debug ' )->addTag ('twig.extension ' );
6565 }
6666
67+ $ composerRootDir = $ this ->getComposerRootDir ($ container ->getParameter ('kernel.root_dir ' ));
68+ $ loader = $ container ->getDefinition ('twig.loader.filesystem ' );
69+ $ loader ->replaceArgument (2 , $ composerRootDir );
70+
6771 if (!$ container ->has ('templating ' )) {
6872 $ loader = $ container ->getDefinition ('twig.loader.native_filesystem ' );
69- $ loader ->replaceArgument (1 , $ this -> getComposerRootDir ( $ container -> getParameter ( ' kernel.root_dir ' )) );
73+ $ loader ->replaceArgument (1 , $ composerRootDir );
7074 $ loader ->addTag ('twig.loader ' );
7175 $ loader ->setMethodCalls ($ container ->getDefinition ('twig.loader.filesystem ' )->getMethodCalls ());
7276
Original file line number Diff line number Diff line change @@ -29,12 +29,13 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
2929 /**
3030 * Constructor.
3131 *
32- * @param FileLocatorInterface $locator A FileLocatorInterface instance
33- * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
32+ * @param FileLocatorInterface $locator A FileLocatorInterface instance
33+ * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
34+ * @param string|null $rootPath The root path common to all relative paths (null for getcwd())
3435 */
35- public function __construct (FileLocatorInterface $ locator , TemplateNameParserInterface $ parser )
36+ public function __construct (FileLocatorInterface $ locator , TemplateNameParserInterface $ parser, $ rootPath = null )
3637 {
37- parent ::__construct (array ());
38+ parent ::__construct (array (), $ rootPath );
3839
3940 $ this ->locator = $ locator ;
4041 $ this ->parser = $ parser ;
Original file line number Diff line number Diff line change 4646
4747 <service id =" twig.loader.native_filesystem" class =" Twig_Loader_Filesystem" public =" false" >
4848 <argument type =" collection" /> <!-- paths -->
49- <argument ></ argument > <!-- project's root dir -->
49+ <argument / > <!-- project's root dir -->
5050 </service >
5151
5252 <service id =" twig.loader.filesystem" class =" Symfony\Bundle\TwigBundle\Loader\FilesystemLoader" public =" false" >
5353 <argument type =" service" id =" templating.locator" />
5454 <argument type =" service" id =" templating.name_parser" />
55+ <argument /> <!-- project's root dir -->
5556 <tag name =" twig.loader" />
5657 </service >
5758
8788
8889 <service id =" twig.extension.code" class =" Symfony\Bridge\Twig\Extension\CodeExtension" public =" false" >
8990 <tag name =" twig.extension" />
90- <argument type =" service" id =" debug.file_link_formatter" ></ argument >
91+ <argument type =" service" id =" debug.file_link_formatter" / >
9192 <argument >%kernel.root_dir%</argument >
9293 <argument >%kernel.charset%</argument >
9394 </service >
You can’t perform that action at this time.
0 commit comments