You are here

public function WebprofilerRequestMatcher::matches in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php \Drupal\webprofiler\RequestMatcher\WebprofilerRequestMatcher::matches()
  2. 8.2 webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php \Drupal\webprofiler\RequestMatcher\WebprofilerRequestMatcher::matches()
  3. 4.x webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php \Drupal\webprofiler\RequestMatcher\WebprofilerRequestMatcher::matches()

File

webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php, line 37

Class

WebprofilerRequestMatcher
Class WebprofilerRequestMatcher

Namespace

Drupal\webprofiler\RequestMatcher

Code

public function matches(Request $request) {
  $path = $request
    ->getPathInfo();
  $patterns = $this->configFactory
    ->get('webprofiler.config')
    ->get('exclude');

  // never add Webprofiler to phpinfo page.
  $patterns .= "\r\n/admin/reports/status/php";

  // never add Webprofiler to uninstall confirm page.
  $patterns .= "\r\n/admin/modules/uninstall/*";
  return !$this->pathMatcher
    ->matchPath($path, $patterns);
}