-
-
Save danbadds38/9a51c32988181b3112de to your computer and use it in GitHub Desktop.
Storing Symfony2 sessions in memcached
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imports: | |
# .... | |
- { resource: services/session.yml } | |
framework: | |
# .... | |
session: | |
handler_id: session.handler.memcached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aptitude install memcached php5-memcached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
# ... | |
session_memcached_host: localhost | |
session_memcached_port: 11211 | |
session_memcached_prefix: sess | |
session_memcached_expire: 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
session.memcached: | |
class: Memcached | |
arguments: | |
persistent_id: %session_memcached_prefix% | |
calls: | |
- [ addServer, [ %session_memcached_host%, %session_memcached_port% ]] | |
session.handler.memcached: | |
class: Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler | |
arguments: [@session.memcached, { prefix: %session_memcached_prefix%, expiretime: %session_memcached_expire% }] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment