[RFC] PSR-11 Container support #30
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a request for comments PR.
This implementation is a discussion starter for DI in fx, it replaces the
$loopconstructor variable with theContainerInterface. I know this is a breaking change but keeping several legacy layers before a public release doesn't makes much sense and increases the maintenance effort.I implemented also 2-3 example usages for the container.
looploggersocketServerContextThe
loopentry is just a simple replacement for the existing$loopparameter.The
loggerentry is aLoggerInterfacedefined by PSR-3 standard. It's used in thelogfunction. Additional to this the request Logger supports now aloggerattribute from the request. This can be used for context logging.The
socketServerContextis an array for thesocketServerwith on addition, it can hold a key nameduriwhich is used for thesocketServeruriparameter. This allows us to define a custom IP and port. Also we can use TLS and set custom parameters for thesocketServer.It adds 2 dependencies
php-di brings a complete dependency injection package but required for other packages is only the
ContainerInterfacepsr/log brings only the PSR-3
LoggerInterfaceBoth dependencies are optional for applications based on fx.
Missing
Just as remark this is just a discussion PR and should be a proof of concept.