merged branch richardmiller/adding_example_to_upgrade_info (PR #5153)
Commits
-------
2c3a7bf
Added before/after examples of change in registering security factories to upgrade info.
Discussion
----------
Added before/after examples of change in registering security factories ...
...to upgrade info.
This commit is contained in:
commit
6f32078b1a
@ -162,6 +162,44 @@
|
|||||||
by the end-user. This means that you will you need to remove the 'factories'
|
by the end-user. This means that you will you need to remove the 'factories'
|
||||||
keys in your security configuration.
|
keys in your security configuration.
|
||||||
|
|
||||||
|
Before:
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
security:
|
||||||
|
factories:
|
||||||
|
- "%kernel.root_dir%/../src/Acme/DemoBundle/Resources/config/security_factories.yml"
|
||||||
|
```
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
# src/Acme/DemoBundle/Resources/config/security_factories.yml
|
||||||
|
services:
|
||||||
|
security.authentication.factory.custom:
|
||||||
|
class: Acme\DemoBundle\DependencyInjection\Security\Factory\CustomFactory
|
||||||
|
tags:
|
||||||
|
- { name: security.listener.factory }
|
||||||
|
```
|
||||||
|
|
||||||
|
After:
|
||||||
|
|
||||||
|
```
|
||||||
|
namespace Acme\DemoBundle;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
use Acme\DemoBundle\DependencyInjection\Security\Factory\CustomFactory;
|
||||||
|
|
||||||
|
class AcmeDemoBundle extends Bundle
|
||||||
|
{
|
||||||
|
public function build(ContainerBuilder $container)
|
||||||
|
{
|
||||||
|
parent::build($container);
|
||||||
|
|
||||||
|
$extension = $container->getExtension('security');
|
||||||
|
$extension->addSecurityListenerFactory(new CustomFactory());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
* The Firewall listener is now registered after the Router listener. This
|
* The Firewall listener is now registered after the Router listener. This
|
||||||
means that specific Firewall URLs (like /login_check and /logout) must now
|
means that specific Firewall URLs (like /login_check and /logout) must now
|
||||||
have proper routes defined in your routing configuration.
|
have proper routes defined in your routing configuration.
|
||||||
|
Reference in New Issue
Block a user