RemoveDevServices example

parent::build($container);

        $this->buildConfig($container$environment);

        $loader = new XmlFileLoader($containernew FileLocator(__DIR__ . '/DependencyInjection/'));
        $loader->load('services.xml');

        if ($environment === 'dev') {
            $loader->load('services_dev.xml');
        }

        $container->addCompilerPass(new RemoveDevServices());
    }

    public function boot(): void
    {
        parent::boot();
        \assert($this->container instanceof ContainerInterface, 'Container is not set yet, please call setContainer() before calling boot(), see `src/Core/Kernel.php:186`.');

        // The profiler registers all profiler integrations in the constructor         // Therefor we need to get the service once to initialize it         $this->container->get(Profiler::class);
    }

    
Home | Imprint | This part of the site doesn't use cookies.