Created
December 18, 2012 11:22
-
-
Save K-Phoen/4327229 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% }] |
https://gist.github.com/elmariachi111/5637669a028c29e3973a better late than never ;)
@cmenning you just made my day! Thanks a lot man!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cmenning Could you please show up your #1 gist?