aboutsummaryrefslogtreecommitdiff
path: root/app/install.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-11-15 15:42:26 +0100
committerGravatar GitHub <noreply@github.com> 2022-11-15 15:42:26 +0100
commit42eeb402ad574236902e40d35d630fa15d29a985 (patch)
tree4eeaedaabcb8ef94b11170f76d55916969b2fe9f /app/install.php
parent07c94061a9607b5d0a1341cc1b349ee094d5115b (diff)
Fix type hints regressions (#4855)
Fix regressions from https://github.com/FreshRSS/FreshRSS/pull/4561 Example: ``` PHP Fatal error: Uncaught TypeError: Argument 1 passed to checkToken() must be an instance of FreshRSS_UserConfiguration, instance of Minz_Configuration given, called in /var/www/FreshRSS/p/api/greader.php on line 1091 and defined in /var/www/FreshRSS/p/api/greader.php:223 Stack trace: #0 /var/www/FreshRSS/p/api/greader.php(1091): checkToken() #1 {main} thrown in /var/www/FreshRSS/p/api/greader.php on line 223 ``` Improvement of https://github.com/FreshRSS/FreshRSS/pull/4110
Diffstat (limited to 'app/install.php')
-rw-r--r--app/install.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/install.php b/app/install.php
index 9d0d855b8..48f39d25e 100644
--- a/app/install.php
+++ b/app/install.php
@@ -283,11 +283,7 @@ function freshrss_already_installed() {
// A configuration file already exists, we try to load it.
$system_conf = null;
try {
- Minz_Configuration::register('system', $conf_path);
- /**
- * @var FreshRSS_SystemConfiguration $system_conf
- */
- $system_conf = Minz_Configuration::get('system');
+ $system_conf = FreshRSS_SystemConfiguration::init($conf_path);
} catch (Minz_FileNotExistException $e) {
return false;
}
@@ -295,7 +291,7 @@ function freshrss_already_installed() {
// ok, the global conf exists… but what about default user conf?
$current_user = $system_conf->default_user;
try {
- Minz_Configuration::register('user', join_path(USERS_PATH, $current_user, 'config.php'));
+ FreshRSS_UserConfiguration::init(USERS_PATH . '/' . $current_user . '/config.php');
} catch (Minz_FileNotExistException $e) {
return false;
}