Configurator/DI: Don't create http and user services by default
- bazo
- Member | 620
Situation:
Need to run only console app or want to use nette di for non nette app.
To just create a container containing only my console app service i had to
install:
nette/application
nette/component-model
nette/security
nette/http
So my suggestion is, create the services bound to these packages only when they are present/loaded
- Jan Tvrdík
- Nette guru | 2595
You are lucky I don't have my moderator power here. What you have written is not nearly an RFC but only poorly written feature request. Or many hours exactly have you spent analyzing current situation and possible solutions?
I will try to guess what you actually want – https://forum.nette.org/…dependencies
+ remove nette/routing
dependency on nette/http
. Did
I guess that right?
Last edited by Jan Tvrdík (2015-01-17 13:57)
- bazo
- Member | 620
@JanTvrdík RFC = request for changes? am i not requesting a change? who said i have to propose solution? if i were you i would be more careful with your millitant approach to everything on this forum.
i've spent exactly 30min figuring out how to make a minimal app with just nette di and config facilities. nowhere in your linked post i see a mention of not creating any unneeded services.
if anybody says, ok, this is a problem, solve it, i will try to solve it. if not, i will rather waste my time some other way.
@enumag what i'm saying is that when the configurator creates the container, it also creates those serfices by default
- enumag
- Member | 2118
@bazo RFC = Request For Comments. It is used when one want to suggest some significant change that needs to be discussed and reviewed by other people. Before sending a RFC one usually spends several weeks or more testing the change he wants to suggest.
Configurator doesn't have much to do with it. The services are created by NetteExtension – which you would know if you dug into it for a few minutes. Sure, Configurator has NetteExtension active by default but you can easily change that – did you even look at the code? In my opinion the only extension active by default should be ExtensionsExtension so I've gone a bit further and written this little class.
EDIT: Also I think you're better of not using configurator at all because nette/bootstrap requires many other nette packages. Require just nette/di and write your own Configurator.
Last edited by enumag (2015-01-18 15:26)
- Jan Tvrdík
- Nette guru | 2595
bazo wrote: RFC = request for changes? am i not requesting a change?
First of all, RFC stands for request for comments. But it is not just request for comments, otherwise every thread on this forum would be RFC.
RFC is describes a problem and proposes a solution. But it is very different from general feature request because RFC is based on research and analysis of the problem. The person who proposes RFC is also usually capable and willing to implement it.
Having abstract Configuration in nette/di might make it easier.
It should not be abstract, just without Nette-specific things
(enableDebugger
, createRobotLoader
, default
extensions, some or maybe all default parameters)
Last edited by Jan Tvrdík (2015-01-18 17:57)