Feat: Allow Dependency Injection from Symfony into Corto#1874
Feat: Allow Dependency Injection from Symfony into Corto#1874johanib merged 1 commit intoupgrade-84from
Conversation
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself. This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4. This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process. The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled. #1874
74fa5f1 to
86ed9ce
Compare
MKodde
left a comment
There was a problem hiding this comment.
Interesting PR! I see you deprecated the current way of working with the 'old' DiContainer. And you hint that any new service should be added to the new runtime version. Would it not be more elegant to move them all right now? That way, you can actually remove the old version in the next version. Now you might run into unforeseen issues and end up keeping the old and the new for a long time.
After discussion:
I agree it would be nice to move most services over. |
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself. This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4. This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process. The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled. #1874
86ed9ce to
ee7ba26
Compare
Done. |
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself. This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4. This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process. The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled. #1874
ee7ba26 to
5dc1e99
Compare
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself. This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4. This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process. The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled. #1874
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself. This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4. This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process. The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled. #1874
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself. This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4. This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process. The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled. #1874
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself. This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4. This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process. The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled. #1874
Prior to this change, it was not possible to inject dependencies into Corto in a modern way. Corto pulled all dependencies from the Symfony service container itself.
This caused issues, because it is no longer possible to pull twig from the service container in Symfony 6.4.
This change introduces a DiContainerRuntime, which can be used to inject dependencies into Corto. This was not possible using the DiContainer, because the DiContainer is constructed during bundle bootstrapping, where DI is not available. It is not possible to move it from there, as it is required by various constructions in the bootstapping process.
The DiContainerRuntime is injected into Corto after bootstrapping, but before the request is handled.
#1874