标签:symfony2
1、添加如下代码到app/config/services.yml:
parameters: memcached.servers: - { host: 127.0.0.1, port: 11211 } services: session.handler.memcached: class: Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler arguments: - "@memcached" - { prefix : "im_" } memcached: class: Memcached calls: - [ addServers, [ %memcached.servers% ]]
2、修改app/config/config.yml文件中的handler_id为上面定义的service id
framework: session: handler_id: session.handler.memcached
本文出自 “LuFux” 博客,请务必保留此出处http://lufux.blog.51cto.com/3482200/1680039
标签:symfony2
原文地址:http://lufux.blog.51cto.com/3482200/1680039