You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allowing the runtime to be set by environment variable
Falling back to the project's composer.json configuration
Each of these options are aimed at providing the end-user (the project developer) with the ability to change the runtime. However, it provides no way for a framework besides Symfony to suggest a default while still enabling user change.
Context
I'm attempting to introduce the Symfony Runtime component into Drupal core. To make this an adoptable change it's not feasible to ask all developers that maintain a Drupal project to update their server configuration, environment, or composer.json.
In theory the SymfonyRuntime works fine and the DrupalKernel is executed using the HttpKernelRunner. However, we would like to use our own runner so that we can adopt the Revolt event loop. The SymfonyRuntime does not provide a way for sometihng that implements HttpKernelInterface to register a more specific runner.
Proposed solution
If no runtime class is specified in the composer.json file, then provide an additional $FALLBACK_RUNTIME (or $FRAMEWORK_RUNTIME?) variable that's checked before falling back to SymfonyRuntime. This allows frameworks to easily set that variable before including autoload_runtime.php.
When you posted this I didn't quite know what you meant. As far as I understand, only the root package is able to configure the autoload_runtime template. However, the code that's shipping the front-controller in this scenario would be the Drupal framework. So as library we wouldn't be allowed to do what you're suggesting.
I've since seen in php-runtime/runtime that they do some magic with the autoloader to make the runtime discoverable. But I couldn't find any documentation for that behaviour so I'm unsure if that's feasible for us.
Was that what you were suggesting instead? How would we go about that? Is adding the autoload configuration enough?
Description
Problem
Currently the Symfony runtime plugin outputs the following configuration for the runtime (and similar behaviour for the runtime options):
This provides three ways to set the runtime:
composer.json
configurationEach of these options are aimed at providing the end-user (the project developer) with the ability to change the runtime. However, it provides no way for a framework besides Symfony to suggest a default while still enabling user change.
Context
I'm attempting to introduce the Symfony Runtime component into Drupal core. To make this an adoptable change it's not feasible to ask all developers that maintain a Drupal project to update their server configuration, environment, or composer.json.
In theory the SymfonyRuntime works fine and the DrupalKernel is executed using the
HttpKernelRunner
. However, we would like to use our own runner so that we can adopt the Revolt event loop. The SymfonyRuntime does not provide a way for sometihng that implements HttpKernelInterface to register a more specific runner.Proposed solution
If no runtime class is specified in the composer.json file, then provide an additional
$FALLBACK_RUNTIME
(or$FRAMEWORK_RUNTIME
?) variable that's checked before falling back to SymfonyRuntime. This allows frameworks to easily set that variable before including autoload_runtime.php.Example
Replacing
with
Would allow a framework to set its own fallback using
Any Symfony application would keep working as expected and ignore the unset
$FALLBACK_RUNTIME
.The text was updated successfully, but these errors were encountered: