diff --git a/config/vufind/httpd-vufind.conf b/config/vufind/httpd-vufind.conf index 1c6f949973067a615551198bc7294db347210b12..5fa16bf7710239cf4881c770c419015503b2d619 100644 --- a/config/vufind/httpd-vufind.conf +++ b/config/vufind/httpd-vufind.conf @@ -61,8 +61,7 @@ Alias /vufind /usr/local/vufind/public #SetEnv VUFIND_ENV development # Uncomment this line if you want to use the XHProf or Tideways profiler; this is a - # developer-oriented option that most users will not need. Make sure the XHProf PHP - # libraries are available on your include path. + # developer-oriented option that most users will not need. # See https://vufind.org/wiki/development:profiling for more details. #SetEnv VUFIND_PROFILER_XHPROF http://url/to/your/xhprof/web/interface diff --git a/public/index.php b/public/index.php index 39a1e9681ea1ab748f7ced4a1a403e8e4e58c20d..0ffe5e85396512b70feb5a0b9e2e6c0dd61ac54f 100644 --- a/public/index.php +++ b/public/index.php @@ -85,11 +85,13 @@ Zend\Mvc\Application::init(require 'config/application.config.php')->run(); // Handle final profiling details, if necessary: if ($xhprof) { $xhprofData = extension_loaded('xhprof') ? xhprof_disable() : tideways_disable(); - require_once "xhprof_lib/utils/xhprof_lib.php"; - require_once "xhprof_lib/utils/xhprof_runs.php"; - $xhprofRuns = new XHProfRuns_Default(); + $xhprofRunId = uniqid(); $suffix = 'vufind'; - $xhprofRunId = $xhprofRuns->save_run($xhprofData, $suffix); + $dir = ini_get('xhprof.output_dir'); + if (empty($dir)) { + $dir = sys_get_temp_dir(); + } + file_put_contents("$dir/$xhprofRunId.$suffix.xhprof", serialize($xhprofData)); $url = "$xhprof?run=$xhprofRunId&source=$suffix"; echo "<a href='$url'>Profiler output</a>"; }