On 03.12.2010, at 11:21, Lukas Kahwe Smith wrote:

> 
> On 03.12.2010, at 10:34, Lukas Kahwe Smith wrote:
> 
>> Sigh .. not sure what I was smoking yesterday, but the above obviously 
>> doesnt work, since I cannot inject anything into a repository class 
>> reliably, since in most cases its the EntityManager making the instance, 
>> that doesnt care about what I specify in the Symfony2 DIC.
> 
> 
> ok .. just learned that with the following i can load whatever service i want:
> 
> security.config:
>    providers:
>        main:
>            password_encoder: &password_encoder
>                sha1
>            id:
>                doctrine_user.repository.user
> 
> that solves the issue.
> 
> however when i inject the request service to be able to read some parameters 
> (for example if the user has accepted the terms of services) then i get:
> Fatal error: Class 'WillNeverBeCalled' not found
> 
> apparently at this point the request service hasn't been "hacked" into the 
> container by the kernel yet.


tried to fix the issue by injecting the container instead, but still doesnt 
work.

the following hack fixes the issue:

diff --git a/src/Symfony/Component/HttpKernel/Kernel.php 
b/src/Symfony/Component/HttpKernel/Kernel.php
index 207a9c8..3c0aed6 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -178,6 +178,7 @@ abstract class Kernel implements HttpKernelInterface, 
\Serializable
             $this->boot();
         }
 
+        $this->container->set('request', $request);
         return $this->container->get('http_kernel')->handle($request, $type, 
$catch);
     }

pretty sure this isn't what i want though :)
i guess i need to step through all the various listeners to figure this one out.

regards,
Lukas Kahwe Smith
[email protected]



-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to