0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-05-13 13:11:54 +00:00

better support for installing plugins via composer

This commit is contained in:
Kevin Papst 2024-10-12 23:50:01 +02:00
parent 255c7d77d6
commit b1d2f5ac55
2 changed files with 4 additions and 15 deletions

View file

@ -169,11 +169,8 @@ class Kernel extends BaseKernel
$routes->import($configDir . '/routes/' . $this->environment . '/*.yaml');
}
// load application routes
$routes->import($configDir . '/routes.yaml');
foreach ($this->getBundles() as $bundle) {
if (str_contains(\get_class($bundle), 'KimaiPlugin\\')) {
if ($bundle instanceof PluginInterface || str_contains(\get_class($bundle), 'KimaiPlugin\\')) {
if (is_dir($bundle->getPath() . '/Resources/config/')) {
$routes->import($bundle->getPath() . '/Resources/config/routes' . self::CONFIG_EXTS);
} elseif (is_dir($bundle->getPath() . '/config/')) {
@ -181,5 +178,8 @@ class Kernel extends BaseKernel
}
}
}
// load application routes as last one, so bundles cannot override application ones
$routes->import($configDir . '/routes.yaml');
}
}

View file

@ -14,17 +14,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
abstract class AbstractPluginExtension extends Extension
{
protected function registerIcon(ContainerBuilder $container, string $name, string $icon): void
{
$container->setParameter(
'tabler_bundle.icons',
array_merge(
$container->getParameter('tabler_bundle.icons'),
[$name => $icon]
)
);
}
protected function registerBundleConfiguration(ContainerBuilder $container, array $configs): void
{
$bundleConfig = [$this->getAlias() => $configs];