Problem/Motivation

Followup from #3583505: Use Symfony PhpDumper instead of a serialized array container structure

Drupal containers are not completely frozen; we override Symfony's Container::set() because we make some changes at runtime:

  public function set(string $id, ?object $service): void {
    // Symfony prevents replacing already-initialized services. Drupal allows
    // this; ModuleInstaller swaps the route provider during module install.
    unset($this->services[$id]);
    parent::set($id, $service);
  }

Steps to reproduce

Proposed resolution

Find out all places that we do this
Figure out a better way
Remove this override

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3585728

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

Instead of swapping route_provider for the lazy builder, the lazy builder now becomes a decorator that does nothing by default, but adds a method to mark the routes as stale so they will be rebuilt on the next route lookup.