From 9c6682e7edf8cbad828088cbeeef66c7ecefdd9a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 2 Jan 2021 21:20:19 +0100 Subject: 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 --- app/Models/Entry.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/Models/Entry.php') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index ed0c1245c..96e1cf3a6 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -355,11 +355,10 @@ class FreshRSS_Entry extends Minz_Model { } public static function getContentByParsing($url, $path, $attributes = array(), $maxRedirs = 3) { - $system_conf = Minz_Configuration::get('system'); - $limits = $system_conf->limits; + $limits = FreshRSS_Context::$system_conf->limits; $feed_timeout = empty($attributes['timeout']) ? 0 : intval($attributes['timeout']); - if ($system_conf->simplepie_syslog_enabled) { + if (FreshRSS_Context::$system_conf->simplepie_syslog_enabled) { syslog(LOG_INFO, 'FreshRSS GET ' . SimplePie_Misc::url_remove_credentials($url)); } @@ -377,7 +376,7 @@ class FreshRSS_Entry extends Minz_Model { CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => '', //Enable all encodings ]); - curl_setopt_array($ch, $system_conf->curl_options); + curl_setopt_array($ch, FreshRSS_Context::$system_conf->curl_options); if (isset($attributes['ssl_verify'])) { curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $attributes['ssl_verify'] ? 2 : 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $attributes['ssl_verify'] ? true : false); -- cgit v1.2.3