From a54e4f0213867d8115c3aa01ceeffedf41bd8fcd Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Fri, 22 Nov 2013 12:28:05 +1300
Subject: [PATCH] Somehow xhprof_error not defined on my box

---
 core/Profiler.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/core/Profiler.php b/core/Profiler.php
index 731a194fc5..712c0e27eb 100644
--- a/core/Profiler.php
+++ b/core/Profiler.php
@@ -195,11 +195,19 @@ class Profiler
         }
 
         $path = PIWIK_INCLUDE_PATH . '/tests/lib/xhprof-0.9.4/xhprof_lib/utils/xhprof_runs.php';
+
         if(!file_exists($path)) {
             return;
         }
 
         require_once $path;
+        require_once PIWIK_INCLUDE_PATH . '/tests/lib/xhprof-0.9.4/xhprof_lib/utils/xhprof_lib.php';
+
+        if(!function_exists('xhprof_error')) {
+            function xhprof_error($out) {
+                echo substr($out, 0, 300) . '...';
+            }
+        }
 
         $currentGitBranch = SettingsPiwik::getCurrentGitBranch();
         $profilerNamespace = "piwik";
-- 
GitLab