Skip to content

Sync DrupalKernel synthetic services #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

Niklan
Copy link
Contributor

@Niklan Niklan commented Jan 24, 2025

Closes #818

This PR synchronizes current DrupalKernel synthetic service definitions with the DrupalAutoloader.

    // Register synthetic services.
    $container->register('class_loader')->setSynthetic(TRUE);
    $container->register('kernel', 'Symfony\Component\HttpKernel\KernelInterface')->setSynthetic(TRUE);
    $container->register('service_container', 'Symfony\Component\DependencyInjection\ContainerInterface')->setSynthetic(TRUE);

    // Register aliases of synthetic services for autowiring.
    $container->setAlias(DrupalKernelInterface::class, 'kernel');
    $container->setAlias(ContainerInterface::class, 'service_container');

https://github.com/drupal/drupal/blob/c6bc6ebf27480b08b4c9ed5a7099ff5eef7e4348/core/lib/Drupal/Core/DrupalKernel.php#L1338-L1345

@mglaman mglaman merged commit e804eff into mglaman:main Mar 27, 2025
13 of 14 checks passed
mglaman added a commit that referenced this pull request Mar 27, 2025
* Sync DrupalKernel synthetic services

* Add alias for DrupalContainer

---------

Co-authored-by: Matt Glaman <[email protected]>
(cherry picked from commit e804eff)
@Niklan Niklan deleted the sync-drupal-kernel-synthetic-services branch March 29, 2025 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle DrupalKernel synthetic services
2 participants