mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-12 07:36:34 +03:00
add zenstruck/redis recipe (#1373)
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
services:
|
||||
Zenstruck\Redis:
|
||||
factory: [ 'Zenstruck\Redis', 'create' ]
|
||||
arguments: [ '%env(REDIS_DSN)%' ]
|
||||
|
||||
# Define additional clients here. See https://github.com/zenstruck/redis#readme
|
||||
# for more details.
|
||||
#
|
||||
# Separate proxy's that have different prefixes:
|
||||
#
|
||||
# redis1:
|
||||
# class: Zenstruck\Redis
|
||||
# factory: ['Zenstruck\Redis', 'create']
|
||||
# arguments: ['%env(REDIS_DSN)%', { prefix: 'prefix1:' }]
|
||||
# redis2:
|
||||
# class: Zenstruck\Redis
|
||||
# factory: ['Zenstruck\Redis', 'create']
|
||||
# arguments: ['%env(REDIS_DSN)%', { prefix: 'prefix2:' }]
|
||||
#
|
||||
# Separate proxy that uses PHP serialization:
|
||||
#
|
||||
# serialization_redis:
|
||||
# class: Zenstruck\Redis
|
||||
# factory: ['Zenstruck\Redis', 'create']
|
||||
# arguments: ['%env(REDIS_DSN)%', { serializer: php }]
|
||||
#
|
||||
# ExpiringSet service:
|
||||
#
|
||||
# active_users:
|
||||
# class: Zenstruck\Redis\Utility\ExpiringSet
|
||||
# factory: ['@Zenstruck\Redis', 'expiringSet']
|
||||
# arguments:
|
||||
# - active_users # redis key
|
||||
#
|
||||
# Configure Redis session storage (symfony/expression-language required)
|
||||
#
|
||||
# redis_session_handler:
|
||||
# class: Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler
|
||||
# arguments:
|
||||
# - "@=service('Zenstruck\\\\Redis').realClient()"
|
||||
#
|
||||
# config/packages/framework.yaml:
|
||||
# framework:
|
||||
# # ...
|
||||
# session:
|
||||
# handler_id: redis_session_handler
|
||||
#
|
||||
# Specific clients that are autowireable:
|
||||
#
|
||||
# Redis:
|
||||
# class: Redis
|
||||
# factory: ['Zenstruck\Redis', 'createClient']
|
||||
# arguments: ['%env(REDIS_DSN)%'] # note REDIS_DSN must be for \Redis client
|
||||
#
|
||||
# RedisArray:
|
||||
# class: RedisArray
|
||||
# factory: ['Zenstruck\Redis', 'createClient']
|
||||
# arguments: ['%env(REDIS_DSN)%'] # note REDIS_DSN must be for \RedisArray client
|
||||
#
|
||||
# RedisCluster:
|
||||
# class: RedisCluster
|
||||
# factory: ['Zenstruck\Redis', 'createClient']
|
||||
# arguments: ['%env(REDIS_DSN)%'] # note REDIS_DSN must be for \RedisCluster client
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/"
|
||||
},
|
||||
"env": {
|
||||
"REDIS_DSN": "redis://localhost"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user