From 73010596f01b9660899267305fe0cf5064428753 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 29 Nov 2018 20:22:15 +1300 Subject: Make matomo.js and matomo.php the default Tracking API endpoints used (#13596) * Make matomo.js and matomo.php the default Tracking API endpoints used * few fixes * fix few tests * update matomo php tracker in composer * make sure to record install version * do not overwrite ever install version * trying to fix test * more tweaks and fix tests * prefer matomo endpoint in the ui, fix some tests * file was still needed * apply review feedback * fix ui tests --- core/DbHelper.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'core/DbHelper.php') diff --git a/core/DbHelper.php b/core/DbHelper.php index 1687cc89e8..fdbbf3bd1f 100644 --- a/core/DbHelper.php +++ b/core/DbHelper.php @@ -93,6 +93,31 @@ class DbHelper Schema::getInstance()->createAnonymousUser(); } + /** + * 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 */ -- cgit v1.2.3