@@ -31,6 +31,8 @@ class Cache implements ConfigOptionsListInterface
3131 public const INPUT_KEY_CACHE_BACKEND_REDIS_PASSWORD = 'cache-backend-redis-password ' ;
3232 public const INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESS_DATA = 'cache-backend-redis-compress-data ' ;
3333 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 ' ;
3436 public const INPUT_KEY_CACHE_ID_PREFIX = 'cache-id-prefix ' ;
3537 public const INPUT_KEY_CACHE_ALLOW_PARALLEL_CACHE_GENERATION = 'allow-parallel-generation ' ;
3638
@@ -41,6 +43,8 @@ class Cache implements ConfigOptionsListInterface
4143 public const CONFIG_PATH_CACHE_BACKEND_PASSWORD = 'cache/frontend/default/backend_options/password ' ;
4244 public const CONFIG_PATH_CACHE_BACKEND_COMPRESS_DATA = 'cache/frontend/default/backend_options/compress_data ' ;
4345 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 ' ;
4448 public const CONFIG_PATH_CACHE_ID_PREFIX = 'cache/frontend/default/id_prefix ' ;
4549 public const CONFIG_PATH_ALLOW_PARALLEL_CACHE_GENERATION = 'cache/allow_parallel_generation ' ;
4650
@@ -55,6 +59,8 @@ class Cache implements ConfigOptionsListInterface
5559 self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESS_DATA => '1 ' ,
5660 self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESSION_LIB => '' ,
5761 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
5864 ];
5965
6066 /**
@@ -75,6 +81,8 @@ class Cache implements ConfigOptionsListInterface
7581 self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESS_DATA => self ::CONFIG_PATH_CACHE_BACKEND_COMPRESS_DATA ,
7682 self ::INPUT_KEY_CACHE_BACKEND_REDIS_COMPRESSION_LIB => self ::CONFIG_PATH_CACHE_BACKEND_COMPRESSION_LIB ,
7783 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 ,
7886 ];
7987
8088 /**
@@ -141,6 +149,12 @@ public function getOptions()
141149 self ::CONFIG_PATH_CACHE_BACKEND_COMPRESSION_LIB ,
142150 'Compression lib to use [snappy,lzf,l4z,zstd,gzip] (leave blank to determine automatically) '
143151 ),
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+ ),
144158 new TextConfigOption (
145159 self ::INPUT_KEY_CACHE_ID_PREFIX ,
146160 TextConfigOption::FRONTEND_WIZARD_TEXT ,
@@ -252,6 +266,20 @@ private function validateRedisConfig(array $options, DeploymentConfig $deploymen
252266 $ this ->getDefaultConfigValue (self ::INPUT_KEY_CACHE_BACKEND_REDIS_PASSWORD )
253267 );
254268
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+
255283 return $ this ->redisValidator ->isValidConnection ($ config );
256284 }
257285
0 commit comments