Skip to content

Commit

Permalink
Make Assetic integration optional (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric authored Jul 12, 2019
1 parent f7421ce commit 56458fa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions bundle/DependencyInjection/EzPublishLegacyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
namespace eZ\Bundle\EzPublishLegacyBundle\DependencyInjection;

use Assetic\Factory\Loader\FormulaLoaderInterface;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
Expand Down Expand Up @@ -42,6 +43,10 @@ public function load(array $configs, ContainerBuilder $container)
// Templating
$loader->load('templating.yml');

if (interface_exists(FormulaLoaderInterface::class)) {
$loader->load('assetic.yml');
}

// View
$loader->load('view.yml');

Expand Down
6 changes: 6 additions & 0 deletions bundle/Resources/config/assetic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
assetic.eztpl_formula_loader:
class: eZ\Publish\Core\MVC\Legacy\Templating\LegacyFormulaLoader
public: false
tags:
- {name: assetic.formula_loader, alias: eztpl}
6 changes: 0 additions & 6 deletions bundle/Resources/config/templating.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ services:
public: false
arguments: ["@ezpublish_legacy.kernel", "@ezpublish_legacy.templating.object_converter"]

assetic.eztpl_formula_loader:
class: eZ\Publish\Core\MVC\Legacy\Templating\LegacyFormulaLoader
public: false
tags:
- {name: assetic.formula_loader, alias: eztpl}

twig.loader.string:
class: eZ\Publish\Core\MVC\Legacy\Templating\Twig\LoaderString
public: false
Expand Down

0 comments on commit 56458fa

Please sign in to comment.