aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-04-07 12:40:43 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-07 12:40:43 +0200
commitdbbae15a8458679db0f4540dacdbdcff9c02ec8c (patch)
tree19d84d19660d3aa8e616f75d5c6eafba99679e1c /app/Models/Context.php
parentd23d10bcde1a9b86c784d58b891f61e740e0124e (diff)
Remove ConfigurationSetter (#5251)
This class has not been maintained for a while. Only a subset of our configuration properties are there, and some code is not relevant anymore. Furthermore, it is relying exclusively on dynamically invoked functions, making it challenging to maintain, in particular to find out what is used and what is not, what is handled and what is not. It is not well suited for changes in data formats, which have been handled in the Context class instead. It is also not able to handle configuration properties that are missing. It is the class with most errors for PHPStan level 6 (179 errors). It is also making intense use of is_callable and call_user_func_array, which are performance killers. Should the need arrise again to perform validation of our internal configuration files, I suggest an implementation with the opposite approach, namely driven by our code instead of driven by the data. In summary, at the moment, this class is costly, while not offering many guarantees.
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php
index 7c7af2791..b2631291a 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -104,9 +104,6 @@ final class FreshRSS_Context {
if ($reload || FreshRSS_Context::$system_conf == null) {
//TODO: Keep in session what we need instead of always reloading from disk
FreshRSS_Context::$system_conf = FreshRSS_SystemConfiguration::init(DATA_PATH . '/config.php', FRESHRSS_PATH . '/config.default.php');
- // Register the configuration setter for the system configuration
- $configurationSetter = new FreshRSS_ConfigurationSetter();
- FreshRSS_Context::$system_conf->_configurationSetter($configurationSetter);
}
return FreshRSS_Context::$system_conf;
}
@@ -132,8 +129,7 @@ final class FreshRSS_Context {
//TODO: Keep in session what we need instead of always reloading from disk
FreshRSS_Context::$user_conf = FreshRSS_UserConfiguration::init(
USERS_PATH . '/' . $username . '/config.php',
- FRESHRSS_PATH . '/config-user.default.php',
- FreshRSS_Context::$system_conf->configurationSetter());
+ FRESHRSS_PATH . '/config-user.default.php');
Minz_User::change($username);
} catch (Exception $ex) {