Skip to content
Snippets Groups Projects
Select Git revision
  • 89d4166cdfe6885b4c67709dbdaeb533fe58c3fc
  • main default
  • keycloak-deprecate
  • remove-jwt-easy
  • ci-update
  • v0.1.15
  • v0.1.14
  • v0.1.13
  • v0.1.12
  • v0.1.11
  • v0.1.10
  • v0.1.9
  • v0.1.8
  • v0.1.7
  • v0.1.6
  • v0.1.5
  • v0.1.4
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
21 results

UserRolesInterface.php

Blame
  • Kernel.php 1.84 KiB
    <?php
    
    declare(strict_types=1);
    
    namespace App;
    
    use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
    use Symfony\Component\Config\Loader\LoaderInterface;
    use Symfony\Component\Config\Resource\FileResource;
    use Symfony\Component\DependencyInjection\ContainerBuilder;
    use Symfony\Component\HttpKernel\Kernel as BaseKernel;
    use Symfony\Component\Routing\RouteCollectionBuilder;
    
    class Kernel extends BaseKernel
    {
        use MicroKernelTrait;
    
        private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
    
        public function registerBundles(): iterable
        {
            $contents = require $this->getProjectDir().'/config/bundles.php';
            foreach ($contents as $class => $envs) {
                if ($envs[$this->environment] ?? $envs['all'] ?? false) {
                    yield new $class();
                }
            }
        }
    
        protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader): void
        {
            $c->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
            $c->setParameter('container.dumper.inline_class_loader', true);
            $confDir = $this->getProjectDir().'/config';
    
            $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
            $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
            $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
            $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
        }
    
        protected function configureRoutes(RouteCollectionBuilder $routes): void
        {
            $confDir = $this->getProjectDir().'/config';
    
            $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');
            $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
            $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
        }
    }