From 42eeb402ad574236902e40d35d630fa15d29a985 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 15 Nov 2022 15:42:26 +0100 Subject: 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 --- app/install.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'app/install.php') 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; } -- cgit v1.2.3