File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7878]);
7979
8080// Database
81- set ('requirements_db_min_version ' , '10.2.7 ' );
81+ set ('requirements_mariadb_min_version ' , '10.2.7 ' );
82+ set ('requirements_mysql_min_version ' , '8.0.0 ' );
8283
8384// User / permissions
8485set ('requirements_user_group ' , 'www-data ' );
Original file line number Diff line number Diff line change @@ -176,7 +176,8 @@ function getSharedEnvVars(): array
176176 $ value = substr ($ value , 1 , -1 );
177177 }
178178
179- $ vars [trim ($ parts [0 ])] = $ value ;
179+ $ key = trim (preg_replace ('/^export\s+/ ' , '' , trim ($ parts [0 ])));
180+ $ vars [$ key ] = $ value ;
180181 }
181182
182183 return $ vars ;
Original file line number Diff line number Diff line change 3535 return ;
3636 }
3737
38- $ minVersion = get ('requirements_db_min_version ' );
39-
40- if (preg_match ('/Distrib\s+([\d.]+)/ ' , $ versionOutput , $ matches )
41- || preg_match ('/Ver\s+([\d.]+)/ ' , $ versionOutput , $ matches )) {
38+ if (preg_match ('/Distrib\s+([\d.]+)/ ' , $ versionOutput , $ matches )) {
39+ $ actualVersion = $ matches [1 ];
40+ $ minVersion = get ('requirements_mariadb_min_version ' );
41+ $ meets = version_compare ($ actualVersion , $ minVersion , '>= ' );
42+ $ info = $ meets ? "MariaDB $ actualVersion " : "MariaDB $ actualVersion (required: >= $ minVersion) " ;
43+ addRequirementRow (
44+ 'Database client ' ,
45+ $ meets ? REQUIREMENT_OK : REQUIREMENT_FAIL ,
46+ $ info
47+ );
48+ } elseif (preg_match ('/Ver\s+([\d.]+)/ ' , $ versionOutput , $ matches )) {
4249 $ actualVersion = $ matches [1 ];
50+ $ minVersion = get ('requirements_mysql_min_version ' );
4351 $ meets = version_compare ($ actualVersion , $ minVersion , '>= ' );
44- $ info = $ meets ? $ actualVersion : "$ actualVersion (required: >= $ minVersion) " ;
52+ $ info = $ meets ? " MySQL $ actualVersion" : "MySQL $ actualVersion (required: >= $ minVersion) " ;
4553 addRequirementRow (
4654 'Database client ' ,
4755 $ meets ? REQUIREMENT_OK : REQUIREMENT_FAIL ,
Original file line number Diff line number Diff line change 1919 return ;
2020 }
2121
22+ $ localeLines = array_map ('trim ' , explode ("\n" , $ availableLocales ));
23+
2224 foreach (get ('requirements_locales ' ) as $ locale ) {
2325 $ normalizedLocale = strtolower ($ locale );
2426 $ altLocale = str_replace ('.utf8 ' , '.utf-8 ' , $ normalizedLocale );
2527
26- if (str_contains ($ availableLocales , $ normalizedLocale )
27- || str_contains ($ availableLocales , $ altLocale )) {
28+ $ found = in_array ($ normalizedLocale , $ localeLines , true )
29+ || in_array ($ altLocale , $ localeLines , true );
30+
31+ if ($ found ) {
2832 addRequirementRow ("Locale: $ locale " , REQUIREMENT_OK , 'Available ' );
2933 } else {
3034 addRequirementRow ("Locale: $ locale " , REQUIREMENT_FAIL , 'Not available ' );
Original file line number Diff line number Diff line change 1313
1414 $ expectedGroup = get ('requirements_user_group ' );
1515
16- // Check primary group
16+ // Check group membership ( primary + supplementary)
1717 try {
18+ $ groups = explode (' ' , trim (run ('id -Gn ' )));
19+ $ meets = in_array ($ expectedGroup , $ groups , true );
1820 $ actualGroup = trim (run ('id -gn ' ));
19- $ meets = ($ actualGroup === $ expectedGroup );
2021 addRequirementRow (
2122 'User group ' ,
2223 $ meets ? REQUIREMENT_OK : REQUIREMENT_WARN ,
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ Checks PHP CLI configuration values against expected minimums:
4242
4343### Database client
4444
45- Checks for the availability of the ` mariadb ` or ` mysql ` client and validates the version against the configured minimum (default : >= 10.2.7).
45+ Checks for the availability of the ` mariadb ` or ` mysql ` client and validates the version against client-specific minimums (MariaDB : >= 10.2.7, MySQL: >= 8.0.0 ).
4646
4747### User and permissions
4848
You can’t perform that action at this time.
0 commit comments