Skip to content

Commit

Permalink
Merged branch '4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Feb 29, 2024
2 parents 584b9e5 + 649041e commit 4510b1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
php:
- '8.0'
- '8.1'
steps:
- uses: actions/checkout@v2

Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@
"lolautruche/ez-core-extra-bundle": "<2.0"
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true
}
"allow-plugins": false
}
}
9 changes: 2 additions & 7 deletions src/bundle/DependencyInjection/Compiler/TwigThemePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;

/**
Expand All @@ -29,10 +28,6 @@ public function process(ContainerBuilder $container)
return;
}

$globalViewsDir = $container->getParameter('twig.default_path');
if (!is_dir($globalViewsDir)) {
(new Filesystem())->mkdir($globalViewsDir);
}
$themesPathMap = [
'_override' => $container->getParameter('ibexa.design.templates.override_paths'),
];
Expand All @@ -54,11 +49,11 @@ public function process(ContainerBuilder $container)

$twigLoaderDef = $container->findDefinition(TwigThemeLoader::class);
// Now look for themes at application level
$appLevelThemesDir = $globalViewsDir . '/themes';
$appLevelThemesDir = $container->getParameter('twig.default_path') . '/themes';
if (is_dir($appLevelThemesDir)) {
foreach ((new Finder())->directories()->in($appLevelThemesDir)->depth('== 0') as $directoryInfo) {
$theme = $directoryInfo->getBasename();
$themePaths = isset($themesPathMap[$theme]) ? $themesPathMap[$theme] : [];
$themePaths = $themesPathMap[$theme] ?? [];
// Application level paths are always top priority.
array_unshift($themePaths, $directoryInfo->getRealPath());
$themesPathMap[$theme] = $themePaths;
Expand Down

0 comments on commit 4510b1c

Please sign in to comment.