Path Sensor Rules

PHP Path Rules defines files containing functions or methods to be instrumented. It serves as a parent to Function/Method Rules. Only functions/methods, belonging to a file, matching parent Path Rule, are evaluated by Function/Method Rules. The full PHP path is evaluated, not just the filename.

Path Rule properties
Path Rule properties

Configure a Path Rule in the Path Rule Properties dialog box:

  • While creating a new Class Rule:
    1. Open the System Profile Preferences dialog box, and select the Sensor item.
    2. Select the required Sensor Group and click Add Path.
  • While editing an existing Class Rule:
    1. Open the System Profile Preferences dialog box, and select the Sensor item.
    2. Select the required Sensor Group, select the Path Rule to be changed and click Edit.

Path pattern

Path Rules do not necessarily specify concrete names of PHP paths. Instead they use patterns. These patterns can be specified using one of the following modes:

  • equals: The pattern applies if the actual name is equal to the pattern text.
  • starts: The pattern applies if the actual name starts with the given pattern text.
  • ends: The pattern applies if the actual name ends with the given pattern text.
Note

A Rule with an empty pattern affects all paths.

Type

A Path Rule can be of two types:

  • Path: Instruments PHP files, matching specified pattern. See the Path pattern section above.
  • Internal: Instruments internal built-in PHP functions in every PHP file.

Place

For Rule to take effect, it should be placed. Unlike sensor rules for Java or .NET, PHP sensor rules have only one placement option — include, which means paths affected by this rule should be instrumented.