xhprof: allow to configure xhprof root
authorAlexander Stintzing <a.stintzing@metaways.de>
Tue, 27 May 2014 15:11:37 +0000 (17:11 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 27 May 2014 20:11:22 +0000 (22:11 +0200)
Change-Id: Ic2ac2a2b0ee380e4c165521766d2bddd77fd0d8f
Reviewed-on: http://gerrit.tine20.com/customers/701
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Core.php

index 951f9d8..5d196f2 100644 (file)
@@ -278,7 +278,6 @@ class Tinebase_Core
 
         if (self::getConfig()->profiler->xhprof) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Enabling xhprof');
-            
             xhprof_enable(XHPROF_FLAGS_MEMORY);
         } 
     }
@@ -309,8 +308,9 @@ class Tinebase_Core
             
             Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Saving xhprof profiling run for method ' . $method);
             
-            $XHPROF_ROOT = '/usr/share/php5-xhprof';
+            $XHPROF_ROOT = $config->path ? $config->path : '/usr/share/php5-xhprof';
             if (file_exists($XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php")) {
+                define(XHPROF_LIB_ROOT, $XHPROF_ROOT . '/xhprof_lib');
                 include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
                 include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
                 $xhprof_runs = new XHProfRuns_Default();