File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1212namespace Cache \AdapterBundle \Factory ;
1313
1414use Cache \Adapter \Memcached \MemcachedCachePool ;
15+ use Cache \AdapterBundle \ProviderHelper \Memcached ;
1516use Symfony \Component \OptionsResolver \OptionsResolver ;
1617
1718/**
@@ -28,7 +29,7 @@ class MemcachedFactory extends AbstractAdapterFactory
2829 */
2930 public function getAdapter (array $ config )
3031 {
31- $ client = new \ Memcached ();
32+ $ client = new Memcached ($ config [ ' persistent_id ' ] );
3233 $ client ->addServer ($ config ['host ' ], $ config ['port ' ]);
3334
3435 return new MemcachedCachePool ($ client );
@@ -40,10 +41,12 @@ public function getAdapter(array $config)
4041 protected static function configureOptionResolver (OptionsResolver $ resolver )
4142 {
4243 $ resolver ->setDefaults ([
43- 'host ' => '127.0.0.1 ' ,
44- 'port ' => 11211 ,
44+ 'persistent_id ' => null ,
45+ 'host ' => '127.0.0.1 ' ,
46+ 'port ' => 11211 ,
4547 ]);
4648
49+ $ resolver ->setAllowedTypes ('persistent_id ' , ['string ' , 'null ' ]);
4750 $ resolver ->setAllowedTypes ('host ' , ['string ' ]);
4851 $ resolver ->setAllowedTypes ('port ' , ['string ' , 'int ' ]);
4952 }
You can’t perform that action at this time.
0 commit comments