-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config/container.php #67
Conversation
Signed-off-by: Aleksei Khudiakov <[email protected]>
Good direction! |
I do like the general approach of having a But I don't agree that initializing/bootstrapping the application during container initialization is a good idea. That's two different stages in the application lifecycle that should be handled separately. #IMO
So the first lines of current Application::init() (until And there should be an <?php
$container = require_once 'container.php';
return Application::init($container); // load modules, attach listeners, bootstrap With regards to laminas/laminas-cli#106: #my-two-cents |
Loading the modules at this point means that the container configuration is incomplete:
|
This depends on how you define when the Container / the App is meant to be ready. IMO this is after Of cause, one could put everything incl. Module Loading into container.php. But then there's no separation between static and dynamic configuration. In my opinion "Container preparation" is all static. Only definitions of things that might be needed. App initialization is more dynamic and the first touchpoint that might already use previously defined dependencies. i.E. fetch Module-Manager look for modules and initialize them, fetch event-manager and attach Listeners ... Indeed difficult is the fact, that Lamainas MVC mixes both parts while loading modules. 🤷 To repeat: If you define App-Initialization (incl. dynamic module loading) as part of Container-Definition, then having everything in I'd rather like to separate both stages. But that's just my personal preference. |
I am not defining anything here, I am describing the current behaviour we have to deal with. 😃 |
Description
Introduce
config/container.php
to match mezzio skeleton and make usage of tools like laminas-cli simpler.See laminas/laminas-cli#106