Hi!

There are some services marked as *synthetic *and some marked with some 
"scope" (request service for example).

Here is the request service definition:
        <!--
            If you want to change the Request class, modify the code in
            your front controller (app.php) so that it passes an instance of
            YourRequestClass to the Kernel.
            This service definition only defines the scope of the request.
            It is used to check references scope.
        -->
        <service id="request" scope="request" synthetic="true" />

When I try to use a "request" service from my own service which has got a 
Service Container inside I receive an Exception:
You cannot create a service ("request") of an inactive scope ("request").
Ok, I digged into Service container source code and found some methods for 
entering scope. But after I do

$this->container->enterScope('request');
$request = $this->container->get('request');

I get another exception:
You have requested a synthetic service ("request"). The DIC does not know 
how to construct this service.
What are those service types and how to use it? Is there any documentation 
anywhere for this?
The request service is defined and then compiled differently than the usual 
service. Why is that?

For my use case - how can I receive a request object inside a service but 
not inside a controller?
I do not need to redefine Request class, just need to receive a request 
object.

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 developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to