Hi all,

I have a service which needs the request service as its first argument. So
far, I've been using this since it's the only way I've found that works for
me:

<service id="request" synthetic="true" />

<service id="my_own_service" class="%my_own_service_class%">
     <argument type="service" id="request" />
</service>


It works nice. But the problem appears if I want to access this service from
a CLI command. Obviusly, it throws this exception:


[RuntimeException]
You have requested a synthetic service ("request"). The DIC does not know
how to construct this service.


So, my question is: How can I solve this problem? This service doesn't need
the request in this case, and it can receive null instead of a Request
instance for these cases, but it always throw this exception, even if I add
"on-invalid="null"' to the argument.

Is there a way to do this?



Thanks in advance!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to