Skip to content

Commit

Permalink
Merge pull request #193 from emulienfou/master
Browse files Browse the repository at this point in the history
Symfony 4.1 compatibility
  • Loading branch information
lsmith77 committed Oct 4, 2018
2 parents 1741d42 + abef6c2 commit ff3d7fa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ matrix:
env: SYMFONY_VERSION=@dev;ASSETIC=skip

before_install:
- if [[ $TRAVIS_PHP_VERSION = '5.6' ]]; then phpenv config-add travis.php.ini; fi
- if [[ $TRAVIS_PHP_VERSION != '7.0' && $TRAVIS_PHP_VERSION != '7.1' && $TRAVIS_PHP_VERSION != '7.2' ]]; then phpenv config-rm xdebug.ini; fi
- composer self-update
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
Expand Down
6 changes: 5 additions & 1 deletion DependencyInjection/Compiler/ThemeCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ public function process(ContainerBuilder $container)
->replaceArgument(2, null);
}

$twigFilesystemLoaderDefinition = $container->getDefinition('twig.loader.filesystem');
$twigFilesystemLoaderDefinition = $container->findDefinition('twig.loader.filesystem');
$twigFilesystemLoaderDefinition->setClass($container->getParameter('liip_theme.filesystem_loader.class'));
$twigFilesystemLoaderDefinition->setArguments(array(
$container->getDefinition('liip_theme.templating_locator'),
$container->getDefinition('templating.filename_parser')
));
$twigFilesystemLoaderDefinition->addMethodCall('setActiveTheme', array(new Reference('liip_theme.active_theme')));
}
}
2 changes: 2 additions & 0 deletions Resources/config/templating.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<argument type="service" id="liip_theme.active_theme" />
</service>

<service id="templating.filename_parser" class="Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser"/>

<service id="templating.finder" class="Liip\ThemeBundle\CacheWarmer\TemplateFinder" public="false">
<argument type="service" id="kernel" />
<argument type="service" id="templating.filename_parser" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testProcess()
;

$containerMock->expects($this->once())
->method('getDefinition')
->method('findDefinition')
->with('twig.loader.filesystem')
->willReturn(
$this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')
Expand Down
1 change: 1 addition & 0 deletions travis.php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
memory_limit = -1

0 comments on commit ff3d7fa

Please sign in to comment.