@@ -63,8 +63,6 @@ First, define a Symfony service for the connection to the Redis server:
6363
6464 .. code-block :: php
6565
66- use Symfony\Component\DependencyInjection\Reference;
67-
6866 // ...
6967 $container
7068 // you can also use \RedisArray, \RedisCluster or \Predis\Client classes
@@ -90,7 +88,7 @@ and ``RedisProxy``:
9088 arguments :
9189 - ' @Redis'
9290 # you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
93- # which define the prefix to use for the keys to avoid collision on the Redis server
91+ # which define the prefix to use for the keys to avoid collision on the Redis server
9492 # and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
9593 # - { 'prefix': 'my_prefix', 'ttl': 600 }
9694
@@ -101,25 +99,27 @@ and ``RedisProxy``:
10199 <service id =" Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler" >
102100 <argument type =" service" id =" Redis" />
103101 <!-- you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
104- which define the prefix to use for the keys to avoid collision on the Redis server
102+ which define the prefix to use for the keys to avoid collision on the Redis server
105103 and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
106104 <argument type="collection">
107105 <argument key="prefix">my_prefix</argument>
106+ <argument key="ttl">600</argument>
108107 </argument> -->
109108 </service >
110109 </services >
111110
112111 .. code-block :: php
113112
114113 // config/services.php
114+ use Symfony\Component\DependencyInjection\Reference;
115115 use Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler;
116116
117117 $container
118118 ->register(RedisSessionHandler::class)
119119 ->addArgument(
120120 new Reference('Redis'),
121121 // you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
122- // which define the prefix to use for the keys to avoid collision on the Redis server
122+ // which define the prefix to use for the keys to avoid collision on the Redis server
123123 // and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
124124 // ['prefix' => 'my_prefix', 'ttl' => 600],
125125 );
@@ -208,7 +208,7 @@ first register a new handler service with your database credentials:
208208 <argument >%env(DATABASE_URL)%</argument >
209209
210210 <!-- you can also use PDO configuration, but requires passing two arguments: -->
211- <!-- <argument>mysql:dbname=mydatabase, host=myhost</argument>
211+ <!-- <argument>mysql:dbname=mydatabase; host=myhost; port=myport </argument>
212212 <argument type="collection">
213213 <argument key="db_username">myuser</argument>
214214 <argument key="db_password">mypassword</argument>
0 commit comments