Skip to content

Commit 518a7d0

Browse files
authored
Merge pull request #55 from skilld-labs/env-output-dir
Allow to override xhprof.output_dir via env
2 parents 1af920b + 8f07580 commit 518a7d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xhprof_lib/utils/xhprof_runs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function __construct($dir = null) {
9191
// if specified, else we default to the directory
9292
// in which the error_log file resides.
9393

94-
if (empty($dir)) {
94+
if (empty($dir) && !($dir = getenv('XHPROF_OUTPUT_DIR'))) {
9595
$dir = ini_get("xhprof.output_dir");
9696
if (empty($dir)) {
9797

@@ -101,7 +101,7 @@ public function __construct($dir = null) {
101101
"Trying {$dir} as default. You can either pass the " .
102102
"directory location as an argument to the constructor ".
103103
"for XHProfRuns_Default() or set xhprof.output_dir ".
104-
"ini param.");
104+
"ini param, or set XHPROF_OUTPUT_DIR environment variable.");
105105
}
106106
}
107107
$this->dir = $dir;

0 commit comments

Comments
 (0)