Horde_Pear_Package_Contents_PatternsMatcher
in package
This class helps with matching file paths against search patterns.
Tags
Table of Contents
- $_patterns : array<string|int, mixed>
- The regular expression patterns.
- __construct() : mixed
- Constructor.
- matches() : bool
- Does the given path match one of the regular expression patterns?
- _getRegExpableSearchString() : string
- Converts $s into a string that can be used with preg_match.
- _prepare() : mixed
- Prepares the list of patterns from the input.
Properties
$_patterns
The regular expression patterns.
protected
array<string|int, mixed>
$_patterns
= array()
Methods
__construct()
Constructor.
public
__construct(array<string|int, mixed> $patterns) : mixed
Parameters
- $patterns : array<string|int, mixed>
-
The patterns.
Return values
mixed —matches()
Does the given path match one of the regular expression patterns?
public
matches(string $path) : bool
Parameters
- $path : string
-
The file path.
Return values
bool —True if one of the pattern matches.
_getRegExpableSearchString()
Converts $s into a string that can be used with preg_match.
protected
_getRegExpableSearchString(string $s) : string
Parameters
- $s : string
-
String with wildcards ? and *.
Return values
string —Search string converted * to .*, ? to ., etc.
_prepare()
Prepares the list of patterns from the input.
protected
_prepare(string $patterns) : mixed
Parameters
- $patterns : string
-
The patterns.