diff options
Diffstat (limited to 'core/DbHelper.php')
-rw-r--r-- | core/DbHelper.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/DbHelper.php b/core/DbHelper.php index 1687cc89e8..fdbbf3bd1f 100644 --- a/core/DbHelper.php +++ b/core/DbHelper.php @@ -94,6 +94,31 @@ class DbHelper } /** + * Records the Matomo version a user used when installing this Matomo for the first time + */ + public static function recordInstallVersion() + { + Schema::getInstance()->recordInstallVersion(); + } + + /** + * Returns which Matomo version was used to install this Matomo for the first time. + */ + public static function getInstallVersion() + { + return Schema::getInstance()->getInstallVersion(); + } + + public static function wasMatomoInstalledBeforeVersion($version) + { + $installVersion = self::getInstallVersion(); + if (empty($installVersion)) { + return true; // we assume yes it was installed + } + return true === version_compare($version, $installVersion, '>'); + } + + /** * Create all tables */ public static function createTables() |