Skip to content

Commit

Permalink
Add warning for obsolete keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Abel committed May 4, 2024
1 parent f95051f commit 168926b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,25 @@ public function __construct(LoggerInterface $logger, IConfig $nextCloudConfigura
. self::CONFIG_KEY . ' which should contain the configuration '
. 'for the app user_backend_sql_raw.');
}

$this->warnAboutObsoleteConfigKeys();
}

public function warnAboutObsoleteConfigKeys()
{
$obsolete_keys = array("db_type", "db_host", "db_port", "db_name", "mariadb_charset");
foreach ($obsolete_keys as $key) {
// not using getConfigValueOrFalse() here, because we want to also catch empty strings
if (array_key_exists(key: $key, array:$this->appConfiguration)) {
$this->logger->warning("The configuration key '{$key}' has been obsolete since "
. "version 2.0.0, has no effect and can be removed.");
}
}
}

/**
* @return string db type to connect to
* @return string dsn to use for db connection
* @throws \UnexpectedValueException
*/
public function getDsn()
{
Expand Down

0 comments on commit 168926b

Please sign in to comment.