From 23f62923fa0b11f9f0c6d530e0dc1cbc5d691e11 Mon Sep 17 00:00:00 2001 From: mattab Date: Sun, 8 Dec 2013 22:23:58 +1300 Subject: Minor messages --- core/Profiler.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/Profiler.php') diff --git a/core/Profiler.php b/core/Profiler.php index d4141f472c..0bf0ac966d 100644 --- a/core/Profiler.php +++ b/core/Profiler.php @@ -204,6 +204,9 @@ class Profiler return; } + if(!is_writable(ini_get("xhprof.output_dir"))) { + throw new \Exception("The profiler output dir '" .ini_get("xhprof.output_dir"). "' should exist and be writable."); + } require_once $path; require_once PIWIK_INCLUDE_PATH . '/tests/lib/xhprof-0.9.4/xhprof_lib/utils/xhprof_lib.php'; @@ -230,6 +233,9 @@ class Profiler $xhprofRuns = new \XHProfRuns_Default(); $runId = $xhprofRuns->save_run($xhprofData, $profilerNamespace); + if(empty($runId)) { + die('could not write profiler run'); + } $runs = self::getProfilingRunIds(); $runs[] = $runId; // $weights = array_fill(0, count($runs), 1); -- cgit v1.2.3