File tree 1 file changed +8
-3
lines changed
src/Components/Health/Checker/HealthChecker
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ private function checkMaxExecutionTime(HealthCollection $collection): void
80
80
81
81
private function checkMemoryLimit (HealthCollection $ collection ): void
82
82
{
83
- $ minMemoryLimit = $ this ->decodePhpSize ('512m ' );
83
+ $ minMemoryLimit = $ this ->parseQuantity ('512m ' );
84
84
$ currentMemoryLimit = \ini_get ('memory_limit ' );
85
85
if ($ currentMemoryLimit === false ) {
86
86
$ collection ->add (
@@ -95,7 +95,7 @@ private function checkMemoryLimit(HealthCollection $collection): void
95
95
return ;
96
96
}
97
97
98
- $ currentMemoryLimit = $ this ->decodePhpSize ($ currentMemoryLimit );
98
+ $ currentMemoryLimit = $ this ->parseQuantity ($ currentMemoryLimit );
99
99
if ($ currentMemoryLimit < $ minMemoryLimit ) {
100
100
$ collection ->add (
101
101
SettingsResult::error (
@@ -143,8 +143,13 @@ private function checkPcreJitActive(HealthCollection $collection): void
143
143
$ collection ->add (SettingsResult::warning ('pcre-jit ' , $ snippet , 'not active ' , 'active ' ));
144
144
}
145
145
146
- private function decodePhpSize (string $ val ): float
146
+ private function parseQuantity (string $ val ): float
147
147
{
148
+ //TODO: remove condition and own calculation when min php version is 8.2
149
+ if (\function_exists ('ini_parse_quantity ' )) {
150
+ return (float ) \ini_parse_quantity ($ val );
151
+ }
152
+
148
153
$ val = mb_strtolower (trim ($ val ));
149
154
$ last = mb_substr ($ val , -1 );
150
155
You can’t perform that action at this time.
0 commit comments