misd-service-development / raven-bundle

Adds Raven authentication to your Symfony2 application
1 stars 1 forks source link

RavenAuthenticationProvider has a dependency on request #11

Closed hoyes closed 11 years ago

hoyes commented 11 years ago

Having just pulled the latest updates, I seem to be having problems running the cache:warmup console command (or cache:clear without the --no-warmup flag). I think this is down to the RavenAuthenticationProvider class accessing the 'request' service in the constructor.

If 'raven: true' is enabled in one of the firewalls, it seems to cause the cache:wamup to create an instance of the RavenAuthenticationProvider class, and because there's no request service when running on the console, I get the error:

InactiveScopeException: You cannot create a service ("request") of an inactive scope ("request").

I'm not entirely sure what the solution is. It could also be something unique to my set-up (although I have tried disabling other bundles), so feel free to close if so!

thewilkybarkid commented 11 years ago

Ah, happens to me too.

I initially tried to set the service scope to request so that I could inject the request directly, but that depends on lots of other security services having the same scope (which they don't by default). The simplest (although a bit ugly) option was to just give up and inject the container!