From 8f07580de443f87c416708c5212cf942da5dac66 Mon Sep 17 00:00:00 2001 From: Andy Postnikov Date: Sat, 27 Mar 2021 04:20:42 +0200 Subject: [PATCH] Allow to override xhprof.output_dir via env --- xhprof_lib/utils/xhprof_runs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xhprof_lib/utils/xhprof_runs.php b/xhprof_lib/utils/xhprof_runs.php index 01e9d069..d9739dbb 100644 --- a/xhprof_lib/utils/xhprof_runs.php +++ b/xhprof_lib/utils/xhprof_runs.php @@ -91,7 +91,7 @@ public function __construct($dir = null) { // if specified, else we default to the directory // in which the error_log file resides. - if (empty($dir)) { + if (empty($dir) && !($dir = getenv('XHPROF_OUTPUT_DIR'))) { $dir = ini_get("xhprof.output_dir"); if (empty($dir)) { @@ -101,7 +101,7 @@ public function __construct($dir = null) { "Trying {$dir} as default. You can either pass the " . "directory location as an argument to the constructor ". "for XHProfRuns_Default() or set xhprof.output_dir ". - "ini param."); + "ini param, or set XHPROF_OUTPUT_DIR environment variable."); } } $this->dir = $dir;