diff options
| author | 2021-01-02 21:20:19 +0100 | |
|---|---|---|
| committer | 2021-01-02 21:20:19 +0100 | |
| commit | 9c6682e7edf8cbad828088cbeeef66c7ecefdd9a (patch) | |
| tree | c8c8a6ba34d49d22497a14ddaf18ae97d8cd5bb1 /cli/_cli.php | |
| parent | 7bc2cc5825547f5b5cf15005fda937e06065b45d (diff) | |
Avoid manual initialisations of system or user configuration (#3070)
* Avoid manual intialisations of system or user configuration
More consistent use of Context
* Simplify FreshRSS_Context::initUser
* Remove a few manual get_user_configuration
* A bit of debugging
* Fix context user init
* Fix install
* Fix concurrency
Concurrent requests could lead to bad race condition
* Fix actualize cron
Fix case when system i initialised several times
Diffstat (limited to 'cli/_cli.php')
| -rw-r--r-- | cli/_cli.php | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cli/_cli.php b/cli/_cli.php index 68a0f8731..dc7ee9d64 100644 --- a/cli/_cli.php +++ b/cli/_cli.php @@ -11,10 +11,7 @@ require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader require(LIB_PATH . '/lib_install.php'); Minz_Session::init('FreshRSS', true); -Minz_Configuration::register('system', - DATA_PATH . '/config.php', - FRESHRSS_PATH . '/config.default.php'); -FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); +FreshRSS_Context::initSystem(); Minz_Translate::init('en'); FreshRSS_Context::$isCli = true; @@ -34,11 +31,9 @@ function cliInitUser($username) { fail('FreshRSS error: user not found: ' . $username . "\n"); } - FreshRSS_Context::$user_conf = get_user_configuration($username); - if (FreshRSS_Context::$user_conf == null) { + if (!FreshRSS_Context::initUser($username)) { fail('FreshRSS error: invalid configuration for user: ' . $username . "\n"); } - Minz_Session::_param('currentUser', $username); return $username; } |
