Commit 986c03b4 authored by Fabien Potencier's avatar Fabien Potencier

added a note about how to use the security outside the handling of a request (refs #473)

parent e0dd7687
......@@ -63,6 +63,14 @@ Registering
"symfony/security": "2.1.*"
}
.. caution::
The security features are only available after the Application has been
booted. So, if you want to use it outside of the handling of a request,
don't forget to call ``boot()`` first::
$application->boot();
Usage
-----
......
......@@ -71,11 +71,6 @@ class SecurityServiceProvider implements ServiceProviderInterface
$app['security.access_rules'] = array();
$app['security'] = $app->share(function ($app) {
// First, force everything to be setup correctly.
// This is needed when using the Security provider outside
// of the handling of a request
$app['security.listener'];
return new SecurityContext($app['security.authentication_manager'], $app['security.access_manager']);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment