Skip to content
This repository has been archived by the owner on Sep 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #24 from Mte90/patch-1
Browse files Browse the repository at this point in the history
Added custom method to filter urls
  • Loading branch information
lauripiisang authored Mar 27, 2019
2 parents 726adf8 + ef59751 commit 0d0e010
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
'profiler.simple_url' => function($url) {
return preg_replace('/\=\d+/', '', $url);
},

//'profiler.replace_url' => function($url) {
// return str_replace('token', '', $url);
//},

'profiler.options' => array(),
);
7 changes: 6 additions & 1 deletion external/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ function () {
$cmd = basename($_SERVER['argv'][0]);
$uri = $cmd . ' ' . implode(' ', array_slice($_SERVER['argv'], 1));
}

$replace_url = Xhgui_Config::read('profiler.replace_url');
if (is_callable($replace_url)) {
$uri = $replace_url($uri);
}

$time = array_key_exists('REQUEST_TIME', $_SERVER)
? $_SERVER['REQUEST_TIME']
Expand Down Expand Up @@ -184,4 +189,4 @@ function () {
error_log('xhgui - ' . $e->getMessage());
}
}
);
);

0 comments on commit 0d0e010

Please sign in to comment.