From 4d0cc39b96a86db5947fb8da897a1d5016ed3d18 Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Mon, 15 Dec 2014 15:38:32 +1300
Subject: [PATCH] Fixes #6841 - catch the exception when loading tracker
 environment to prevent error on screen

---
 piwik.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/piwik.php b/piwik.php
index 271825f81a..edce11447e 100644
--- a/piwik.php
+++ b/piwik.php
@@ -67,11 +67,15 @@ require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Cache.php';
 require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Request.php';
 require_once PIWIK_INCLUDE_PATH . '/core/Cookie.php';
 
-Tracker::loadTrackerEnvironment();
-
 session_cache_limiter('nocache');
 @date_default_timezone_set('UTC');
 
+try {
+    Tracker::loadTrackerEnvironment();
+} catch (Exception $e) {
+    // eg. Piwik is not installed yet
+}
+
 $tracker    = new Tracker();
 $requestSet = new RequestSet();
 
-- 
GitLab