@@ -31,6 +31,8 @@ class Cache implements ConfigOptionsListInterface
31
31
public const INPUT_KEY_CACHE_BACKEND_REDIS_PASSWORD = 'cache-backend-redis-password ' ;
32
32
public const INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESS_DATA = 'cache-backend-redis-compress-data ' ;
33
33
public const INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESSION_LIB = 'cache-backend-redis-compression-lib ' ;
34
+ public const INPUT_KEY_CACHE_BACKEND_REDIS_LUA_KEY = 'cache-backend-redis-lua-key ' ;
35
+ public const INPUT_KEY_CACHE_BACKEND_REDIS_USE_LUA = 'cache-backend-redis-use-lua ' ;
34
36
public const INPUT_KEY_CACHE_ID_PREFIX = 'cache-id-prefix ' ;
35
37
public const INPUT_KEY_CACHE_ALLOW_PARALLEL_CACHE_GENERATION = 'allow-parallel-generation ' ;
36
38
@@ -41,6 +43,8 @@ class Cache implements ConfigOptionsListInterface
41
43
public const CONFIG_PATH_CACHE_BACKEND_PASSWORD = 'cache/frontend/default/backend_options/password ' ;
42
44
public const CONFIG_PATH_CACHE_BACKEND_COMPRESS_DATA = 'cache/frontend/default/backend_options/compress_data ' ;
43
45
public const CONFIG_PATH_CACHE_BACKEND_COMPRESSION_LIB = 'cache/frontend/default/backend_options/compression_lib ' ;
46
+ public const CONFIG_PATH_CACHE_BACKEND_LUA_KEY = 'cache/frontend/default/backend_options/_useLua ' ;
47
+ public const CONFIG_PATH_CACHE_BACKEND_USE_LUA = 'cache/frontend/default/backend_options/use_lua ' ;
44
48
public const CONFIG_PATH_CACHE_ID_PREFIX = 'cache/frontend/default/id_prefix ' ;
45
49
public const CONFIG_PATH_ALLOW_PARALLEL_CACHE_GENERATION = 'cache/allow_parallel_generation ' ;
46
50
@@ -55,6 +59,8 @@ class Cache implements ConfigOptionsListInterface
55
59
self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESS_DATA => '1 ' ,
56
60
self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESSION_LIB => '' ,
57
61
self ::INPUT_KEY_CACHE_ALLOW_PARALLEL_CACHE_GENERATION => 'false ' ,
62
+ self ::INPUT_KEY_CACHE_BACKEND_REDIS_LUA_KEY => true ,
63
+ self ::INPUT_KEY_CACHE_BACKEND_REDIS_USE_LUA => false
58
64
];
59
65
60
66
/**
@@ -75,6 +81,8 @@ class Cache implements ConfigOptionsListInterface
75
81
self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESS_DATA => self ::CONFIG_PATH_CACHE_BACKEND_COMPRESS_DATA ,
76
82
self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESSION_LIB => self ::CONFIG_PATH_CACHE_BACKEND_COMPRESSION_LIB ,
77
83
self ::INPUT_KEY_CACHE_ALLOW_PARALLEL_CACHE_GENERATION => self ::CONFIG_PATH_ALLOW_PARALLEL_CACHE_GENERATION ,
84
+ self ::INPUT_KEY_CACHE_BACKEND_REDIS_LUA_KEY => self ::CONFIG_PATH_CACHE_BACKEND_LUA_KEY ,
85
+ self ::INPUT_KEY_CACHE_BACKEND_REDIS_USE_LUA => self ::CONFIG_PATH_CACHE_BACKEND_USE_LUA ,
78
86
];
79
87
80
88
/**
@@ -141,6 +149,12 @@ public function getOptions()
141
149
self ::CONFIG_PATH_CACHE_BACKEND_COMPRESSION_LIB ,
142
150
'Compression lib to use [snappy,lzf,l4z,zstd,gzip] (leave blank to determine automatically) '
143
151
),
152
+ new TextConfigOption (
153
+ self ::INPUT_KEY_CACHE_BACKEND_REDIS_USE_LUA ,
154
+ TextConfigOption::FRONTEND_WIZARD_TEXT ,
155
+ self ::CONFIG_PATH_CACHE_BACKEND_USE_LUA ,
156
+ 'Set to 1 to enable lua (default is 0, disabled) '
157
+ ),
144
158
new TextConfigOption (
145
159
self ::INPUT_KEY_CACHE_ID_PREFIX ,
146
160
TextConfigOption::FRONTEND_WIZARD_TEXT ,
@@ -252,6 +266,20 @@ private function validateRedisConfig(array $options, DeploymentConfig $deploymen
252
266
$ this ->getDefaultConfigValue (self ::INPUT_KEY_CACHE_BACKEND_REDIS_PASSWORD )
253
267
);
254
268
269
+ $ config ['_useLua ' ] = isset ($ options [self ::INPUT_KEY_CACHE_BACKEND_REDIS_LUA_KEY ])
270
+ ? $ options [self ::INPUT_KEY_CACHE_BACKEND_REDIS_LUA_KEY ]
271
+ : $ deploymentConfig ->get (
272
+ self ::CONFIG_PATH_CACHE_BACKEND_LUA_KEY ,
273
+ $ this ->getDefaultConfigValue (self ::CONFIG_PATH_CACHE_BACKEND_LUA_KEY )
274
+ );
275
+
276
+ $ config ['use_lua ' ] = isset ($ options [self ::INPUT_KEY_CACHE_BACKEND_REDIS_USE_LUA ])
277
+ ? $ options [self ::INPUT_KEY_CACHE_BACKEND_REDIS_USE_LUA ]
278
+ : $ deploymentConfig ->get (
279
+ self ::CONFIG_PATH_CACHE_BACKEND_USE_LUA ,
280
+ $ this ->getDefaultConfigValue (self ::CONFIG_PATH_CACHE_BACKEND_USE_LUA )
281
+ );
282
+
255
283
return $ this ->redisValidator ->isValidConnection ($ config );
256
284
}
257
285
0 commit comments