-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
2.3 bc breaks #53
Comments
You should never add any services after loadConfiguration, even if you have to partially configure them later! |
@lookyman well, I understand that this is the only way how to get this working now, but it's massive BC break, nowhere mentioned; also the API & the method name is bad, it makes me really unhappy to create service definitions in method named loadConfiguration. There are two possibilities:
But, to be honest, the motivation to call prepareClassList() (added after my feature request), is exactly the possibility to add services dynamicly in beforeCompile time. Otherwise, I don't see much added value. |
http://doc.nette.org/en/2.2/di-extensions#toc-beforecompile
You're doin' it wrong ;-) |
Service definitions are configuration of DIC. So it was meant as "load your configuration into container builder", not "load configuration from some file or whatever". |
@hrach There is actually much more added value by the early preparedClassList. Mainly Kdyby/Events don't work well without it and now we can use |
@dg Thanks! What about deprecating adding new service in beforeCompile()? |
Can't believe that nobody has complained yet. I'm trying to run my OrmExtension. I'm not sure if I understand the problem correctly, but I think there are 2 issues/BC breaks.:
https://github.com/nextras/orm/blob/fe20359d7b557d83157d4a71d610e21a36c574f1/src/Bridge/NetteDI/OrmExtension.php
$this->builder->prepareClassList();
call is needed.The text was updated successfully, but these errors were encountered: