Skip to content

Commit

Permalink
Update min PHP version check, cleanup outdated checks/comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Feb 23, 2025
1 parent 8bd1c93 commit a9b1ca3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugins/managesieve/managesieve.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function init_ui()
'I' => $dt->format('I'),
'O' => $dt->format('O'),
'P' => $dt->format('P'),
'p' => version_compare(\PHP_VERSION, '8.0.0') >= 0 ? $dt->format('p') : $dt->format('P'),
'p' => $dt->format('p'),
'T' => $dt->format('T'),
'Z' => $dt->format('Z'),
]);
Expand Down
4 changes: 2 additions & 2 deletions program/include/iniset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
+-----------------------------------------------------------------------+
*/

if (\PHP_VERSION_ID < 70300) {
exit('Unsupported PHP version. Required PHP >= 7.3.');
if (\PHP_VERSION_ID < 80100) {
exit('Unsupported PHP version. Required PHP >= 8.1.');
}

// application constants
Expand Down
16 changes: 3 additions & 13 deletions program/lib/Roundcube/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,12 @@
+-----------------------------------------------------------------------+
*/

/**
* Roundcube Framework Initialization
*/

// Some users are not using Installer, so we'll check some critical PHP settings here
$config = [
'display_errors' => false,
'log_errors' => true,
];

// Some users are not using Installer, so we'll check some
// critical PHP settings here. Only these, which doesn't provide
// an error/warning in the logs later. See (#1486307).
if (\PHP_MAJOR_VERSION < 8) {
$config += [
'mbstring.func_overload' => 0,
];
}

// check these additional ini settings if not called via CLI
if (\PHP_SAPI != 'cli') {
$config += [
Expand All @@ -47,8 +35,10 @@
}

foreach ($config as $optname => $optval) {
// @phpstan-ignore-next-line
$ini_optval = filter_var(ini_get($optname), is_bool($optval) ? \FILTER_VALIDATE_BOOLEAN : \FILTER_VALIDATE_INT);
if ($optval != $ini_optval && @ini_set($optname, $optval) === false) {
// @phpstan-ignore-next-line
$optval = !is_bool($optval) ? $optval : ($optval ? 'On' : 'Off');
$error = "ERROR: Wrong '{$optname}' option value and it wasn't possible to set it to required value ({$optval}).\n"
. 'Check your PHP configuration (including php_admin_flag).';
Expand Down

0 comments on commit a9b1ca3

Please sign in to comment.