diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-09-04 11:50:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 11:50:19 +0300 |
commit | 3055d1ec04785fdfb0b6ba8415301585298e4d15 (patch) | |
tree | 2d3a8c7aaf6d82c47d75ab71a91195f4d6c17dab /core | |
parent | ee1fe40d0fabc43ca583e01d0848eac9b86cbd33 (diff) |
System check: Add Matomo Version History and download feature (#16386)
* System check: Add Matomo Version History and download feature
* minor tweak
* update screenshots
* update screenshot
Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/Updater.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/Updater.php b/core/Updater.php index 36f5bcd2cc..a905385af9 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -25,6 +25,7 @@ class Updater { const INDEX_CURRENT_VERSION = 0; const INDEX_NEW_VERSION = 1; + const OPTION_KEY_MATOMO_UPDATE_HISTORY = 'MatomoUpdateHistory'; private $pathUpdateFileCore; private $pathUpdateFilePlugins; @@ -459,6 +460,22 @@ class Updater $deactivatedPlugins = array(); $coreError = false; + try { + $history = Option::get(self::OPTION_KEY_MATOMO_UPDATE_HISTORY); + $history = explode(',', (string) $history); + $previousVersion = Option::get(self::getNameInOptionTable('core')); + + if (!empty($previousVersion) && !in_array($previousVersion, $history, true)) { + // this allows us to see which versions of matomo the user was using before this update so we better understand + // which version maybe regressed something + array_unshift( $history, $previousVersion ); + $history = array_slice( $history, 0, 6 ); // lets keep only the last 6 versions + Option::set(self::OPTION_KEY_MATOMO_UPDATE_HISTORY, implode(',', $history)); + } + } catch (\Exception $e) { + // case when the option table is not yet created (before 0.2.10) + } + if (!empty($componentsWithUpdateFile)) { $currentAccess = Access::getInstance(); $hasSuperUserAccess = $currentAccess->hasSuperUserAccess(); |