Skip to content

Commit 9fd6d58

Browse files
authored
Merge pull request #8764 from magento-gl/Hammer-2.4.7-Beta3-Delivery-16Feb
Hammer 2.4.7 delivery 16 feb
2 parents d62ea3e + acebae9 commit 9fd6d58

File tree

5 files changed

+73
-27
lines changed

5 files changed

+73
-27
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"ext-zip": "*",
3737
"lib-libxml": "*",
3838
"colinmollenhour/cache-backend-file": "^1.4",
39-
"colinmollenhour/cache-backend-redis": "~1.16.0",
40-
"colinmollenhour/credis": "~1.15.0",
39+
"colinmollenhour/cache-backend-redis": "^1.16",
40+
"colinmollenhour/credis": "^1.15",
4141
"colinmollenhour/php-redis-session-abstract": "^1.5",
4242
"composer/composer": "^2.0, !=2.2.16",
4343
"elasticsearch/elasticsearch": "~7.17.0 || ~8.5.0",
@@ -101,7 +101,7 @@
101101
"magento/magento2-functional-testing-framework": "^4.7",
102102
"pdepend/pdepend": "^2.10",
103103
"phpmd/phpmd": "^2.12",
104-
"phpstan/phpstan": "^1.9, <1.10.29",
104+
"phpstan/phpstan": "^1.9",
105105
"phpunit/phpunit": "^9.5",
106106
"sebastian/phpcpd": "^6.0",
107107
"symfony/finder": "^6.4"

composer.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/web/moment.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/CacheTest.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function setUp(): void
4949
public function testGetOptions()
5050
{
5151
$options = $this->configOptionsList->getOptions();
52-
$this->assertCount(9, $options);
52+
$this->assertCount(10, $options);
5353

5454
$this->assertArrayHasKey(0, $options);
5555
$this->assertInstanceOf(SelectConfigOption::class, $options[0]);
@@ -81,11 +81,15 @@ public function testGetOptions()
8181

8282
$this->assertArrayHasKey(7, $options);
8383
$this->assertInstanceOf(TextConfigOption::class, $options[7]);
84-
$this->assertEquals('cache-id-prefix', $options[7]->getName());
84+
$this->assertEquals('cache-backend-redis-use-lua', $options[7]->getName());
8585

8686
$this->assertArrayHasKey(8, $options);
87-
$this->assertInstanceOf(FlagConfigOption::class, $options[8]);
88-
$this->assertEquals('allow-parallel-generation', $options[8]->getName());
87+
$this->assertInstanceOf(TextConfigOption::class, $options[8]);
88+
$this->assertEquals('cache-id-prefix', $options[8]->getName());
89+
90+
$this->assertArrayHasKey(9, $options);
91+
$this->assertInstanceOf(FlagConfigOption::class, $options[9]);
92+
$this->assertEquals('allow-parallel-generation', $options[9]->getName());
8993
}
9094

9195
/**
@@ -107,6 +111,8 @@ public function testCreateConfigCacheRedis()
107111
'password' => '',
108112
'compress_data' => '',
109113
'compression_lib' => '',
114+
'_useLua' => '',
115+
'use_lua' => ''
110116
],
111117
'id_prefix' => $this->expectedIdPrefix(),
112118
]
@@ -158,6 +164,8 @@ public function testCreateConfigWithRedisConfig()
158164
'password' => '',
159165
'compress_data' => '1',
160166
'compression_lib' => 'gzip',
167+
'_useLua' => null,
168+
'use_lua' => null
161169
],
162170
]
163171
],
@@ -238,7 +246,14 @@ public function testValidateWithValidInput()
238246
];
239247
$this->validatorMock->expects($this->once())
240248
->method('isValidConnection')
241-
->with(['host' => 'localhost', 'db' => '', 'port' => '', 'password' => ''])
249+
->with([
250+
'host' => 'localhost',
251+
'db' => '',
252+
'port' => '',
253+
'password' => '',
254+
'_useLua' => null,
255+
'use_lua' => null
256+
])
242257
->willReturn(true);
243258

244259
$errors = $this->configOptionsList->validate($options, $this->deploymentConfigMock);

0 commit comments

Comments
 (0)