You are here

class XHProfRequestMatcher in XHProf 8

Class WebprofilerRequestMatcher

Hierarchy

  • class \Drupal\xhprof\RequestMatcher\XHProfRequestMatcher implements \Symfony\Component\HttpFoundation\RequestMatcherInterface

Expanded class hierarchy of XHProfRequestMatcher

1 string reference to 'XHProfRequestMatcher'
xhprof.services.yml in ./xhprof.services.yml
xhprof.services.yml
1 service uses XHProfRequestMatcher
xhprof.matcher in ./xhprof.services.yml
Drupal\xhprof\RequestMatcher\XHProfRequestMatcher

File

src/RequestMatcher/XHProfRequestMatcher.php, line 13

Namespace

Drupal\xhprof\RequestMatcher
View source
class XHProfRequestMatcher implements RequestMatcherInterface {

  /**
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  private $configFactory;

  /**
   * @var \Drupal\Core\Path\PathMatcherInterface
   */
  private $pathMatcher;

  /**
   * @param ConfigFactoryInterface $configFactory
   * @param \Drupal\Core\Path\PathMatcherInterface $pathMatcher
   */
  public function __construct(ConfigFactoryInterface $configFactory, PathMatcherInterface $pathMatcher) {
    $this->configFactory = $configFactory;
    $this->pathMatcher = $pathMatcher;
  }

  /**
   * {@inheritdoc}
   */
  public function matches(Request $request) {
    $path = $request
      ->getPathInfo();
    $patterns = $this->configFactory
      ->get('xhprof.config')
      ->get('exclude');

    // Never collect phpinfo page.
    $patterns .= "\r\n/admin/reports/status/php";
    return !$this->pathMatcher
      ->matchPath($path, $patterns);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
XHProfRequestMatcher::$configFactory private property
XHProfRequestMatcher::$pathMatcher private property
XHProfRequestMatcher::matches public function Decides whether the rule(s) implemented by the strategy matches the supplied request.
XHProfRequestMatcher::__construct public function