File tree Expand file tree Collapse file tree
src/Components/Health/Checker/HealthChecker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ private function checkMaxExecutionTime(HealthCollection $collection): void
8080
8181 private function checkMemoryLimit (HealthCollection $ collection ): void
8282 {
83- $ minMemoryLimit = $ this ->decodePhpSize ('512m ' );
83+ $ minMemoryLimit = $ this ->parseQuantity ('512m ' );
8484 $ currentMemoryLimit = \ini_get ('memory_limit ' );
8585 if ($ currentMemoryLimit === false ) {
8686 $ collection ->add (
@@ -95,7 +95,7 @@ private function checkMemoryLimit(HealthCollection $collection): void
9595 return ;
9696 }
9797
98- $ currentMemoryLimit = $ this ->decodePhpSize ($ currentMemoryLimit );
98+ $ currentMemoryLimit = $ this ->parseQuantity ($ currentMemoryLimit );
9999 if ($ currentMemoryLimit < $ minMemoryLimit ) {
100100 $ collection ->add (
101101 SettingsResult::error (
@@ -143,8 +143,13 @@ private function checkPcreJitActive(HealthCollection $collection): void
143143 $ collection ->add (SettingsResult::warning ('pcre-jit ' , $ snippet , 'not active ' , 'active ' ));
144144 }
145145
146- private function decodePhpSize (string $ val ): float
146+ private function parseQuantity (string $ val ): float
147147 {
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+
148153 $ val = mb_strtolower (trim ($ val ));
149154 $ last = mb_substr ($ val , -1 );
150155
You can’t perform that action at this time.
0 commit comments