security/acme-client: fix PHP deprecation warnings, closes #3892

This commit is contained in:
Frank Wall 2024-04-08 23:33:04 +02:00
parent 0eb9557470
commit f6422ce2f6
3 changed files with 9 additions and 9 deletions

View file

@ -347,14 +347,14 @@ class SettingsController extends ApiMutableModelControllerBase
// Link to ACME Action is currently missing: add it!
if (!empty((string)$_actions)) {
// Extend existing string.
$_actions .= ",${action_ref}";
$_actions .= ",{$action_ref}";
} else {
// First linked Action for this frontend.
$_actions = $action_ref;
}
// Add modified list of linked Actions to frontend.
$frontend->linkedActions = $_actions;
$this->getLogger()->error("AcmeClient: HAProxy integration: updating frontend ${_frontend}");
$this->getLogger()->error("AcmeClient: HAProxy integration: updating frontend {$_frontend}");
// We need to write changes to config.
$integration_changes = true;
}

View file

@ -44,26 +44,26 @@ class M1_6_0 extends BaseModelMigration
foreach ($model->getNodeByReference('accounts.account')->iterateItems() as $account) {
$account_id = (string)$account->id;
$account_dir = $dir . $account_id;
$new_account_dir = "${dir}${account_id}_${env}";
$new_account_dir = "{$dir}{$account_id}_{$env}";
// Check if account directory exists
// Accounts that haven't been used yet don't need to be migrated.
if (is_dir($account_dir)) {
// Check if account configuration can be found.
$account_file = "${account_dir}/account.conf";
$account_file = "{$account_dir}/account.conf";
if (is_file($account_file)) {
// Parse config file and modify path information
$account_conf = parse_ini_file($account_file);
foreach ($account_conf as $key => $value) {
switch ($key) {
case 'ACCOUNT_KEY_PATH':
$account_conf[$key] = "${new_account_dir}/account.key";
$account_conf[$key] = "{$new_account_dir}/account.key";
break;
case 'ACCOUNT_JSON_PATH':
$account_conf[$key] = "${new_account_dir}/account.json";
$account_conf[$key] = "{$new_account_dir}/account.json";
break;
case 'CA_CONF':
$account_conf[$key] = "${new_account_dir}/ca.conf";
$account_conf[$key] = "{$new_account_dir}/ca.conf";
break;
}
}
@ -71,7 +71,7 @@ class M1_6_0 extends BaseModelMigration
// Convert array back to ini file format
$new_account_conf = array();
foreach ($account_conf as $key => $value) {
$new_account_conf[] = "${key}='${value}'";
$new_account_conf[] = "{$key}='{$value}'";
}
// Write changes back to file

View file

@ -54,7 +54,7 @@ class M4_0_0 extends BaseModelMigration
// Convert array back to ini file format
$new_account_conf = array();
foreach ($account_conf as $key => $value) {
$new_account_conf[] = "${key}='${value}'";
$new_account_conf[] = "{$key}='{$value}'";
}
// Write changes back to file