Problem/Motivation
#3583505: Use Symfony PhpDumper instead of a serialized array container structure is discussing moving the runtime container from our custom array structure to PHP.
The bootstrap container is a very small container (six services) that is used to retrieve and start the runtime container.
Currently this is defined as a static array that is parsed and services are constructed from there. To save parsing this on every request we could just hardcode this as a simple PHP container implementation that will live in opcache.
Steps to reproduce
Proposed resolution
Convert DrupalKernel::$defaultBootstrapContainerDefinition to a PHP class.
Retain the ability for users to override this container in settings.php.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3585294
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
Comment #2
longwaveComment #4
longwaveI guess we could remove the bootstrap container class entirely:
Comment #5
nicxvan commentedNot quite exactly related, but it seems in similar space as #3576593: Create pre-bootstrap extension mechanism
Comment #6
longwaveThe types come from upstream, I think we should leave them alone - we could narrow them but are we trapping ourselves if we do?
If we extract the service creation into its own method and allow the class name to be set in settings.php, then this would be more extensible by downstream users such as Redis.
Comment #7
longwaveNow postponing on #3583505: Use Symfony PhpDumper instead of a serialized array container structure as we are adding to the bootstrap container over there.