aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-10-31 18:15:47 +0100
committerGravatar GitHub <noreply@github.com> 2019-10-31 18:15:47 +0100
commit3aa66f317b496ccd9a2df914bbc747c52081a7ad (patch)
tree6a3f3f74899801abdca00546e213dfdc141c53cf /app/Models/Context.php
parent82611c9622ed23b0e9fcf5f9f651ddffa1fd7706 (diff)
parentfcae48f313d399050cb15f37a8a73ae52fc67796 (diff)
Merge pull request #2599 from FreshRSS/dev1.15.0
FreshRSS 1.15
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php
index 95dc47c8c..e27330665 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -51,6 +51,24 @@ class FreshRSS_Context {
// Init configuration.
self::$system_conf = Minz_Configuration::get('system');
self::$user_conf = Minz_Configuration::get('user');
+
+ //Legacy
+ $oldEntries = (int)FreshRSS_Context::$user_conf->param('old_entries', 0);
+ $keepMin = (int)FreshRSS_Context::$user_conf->param('keep_history_default', -5);
+ if ($oldEntries > 0 || $keepMin > -5) { //Freshrss < 1.15
+ $archiving = FreshRSS_Context::$user_conf->archiving;
+ $archiving['keep_max'] = false;
+ if ($oldEntries > 0) {
+ $archiving['keep_period'] = 'P' . $oldEntries . 'M';
+ }
+ if ($keepMin > 0) {
+ $archiving['keep_min'] = $keepMin;
+ } elseif ($keepMin == -1) { //Infinite
+ $archiving['keep_period'] = false;
+ $archiving['keep_min'] = false;
+ }
+ FreshRSS_Context::$user_conf->archiving = $archiving;
+ }
}
/**