File tree Expand file tree Collapse file tree 1 file changed +27
-7
lines changed Expand file tree Collapse file tree 1 file changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,34 @@ First, define a Symfony service for the connection to the Redis server:
46
46
Now pass this Redis connection as an argument of the service associated to the
47
47
:class: `Symfony\C omponent\H ttpFoundation\S ession\S torage\H andler\R edisSessionHandler `:
48
48
49
- .. code -block :: yaml
49
+ .. configuration -block ::
50
50
51
- # config/services.yaml
52
- services :
53
- # ...
54
- Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler :
55
- arguments :
56
- - ' @Redis'
51
+ .. code-block :: yaml
52
+
53
+ # config/services.yaml
54
+ services :
55
+ # ...
56
+ Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler :
57
+ arguments :
58
+ - ' @Redis'
59
+
60
+ .. code-block :: xml
61
+
62
+ <!-- config/services.xml -->
63
+ <services >
64
+ <service id =" Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler" >
65
+ <argument type =" service" id =" Redis" />
66
+ </service >
67
+ </services >
68
+
69
+ .. code-block :: php
70
+
71
+ // config/services.php
72
+ use Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler;
73
+
74
+ $container
75
+ ->register(RedisSessionHandler::class)
76
+ ->addArgument(new Reference('Redis'));
57
77
58
78
Next, use the :ref: `handler_id <config-framework-session-handler-id >`
59
79
configuration option to tell Symfony to use this service as the session handler:
You can’t perform that action at this time.
0 commit comments