\Horde_Pear_Package_Contents_PatternsMatcher

This class helps with matching file paths against search patterns.

Summary

Methods
Properties
Constants
__construct()
matches()
No public properties found
No constants found
_prepare()
_getRegExpableSearchString()
$_patterns
N/A
No private methods found
No private properties found
N/A

Properties

$_patterns

$_patterns : array

The regular expression patterns.

Type

array

Methods

__construct()

__construct(array  $patterns) 

Constructor.

Parameters

array $patterns

The patterns.

matches()

matches(string  $path) : boolean

Does the given path match one of the regular expression patterns?

Parameters

string $path

The file path.

Returns

boolean —

True if one of the pattern matches.

_prepare()

_prepare(string  $patterns) 

Prepares the list of patterns from the input.

Parameters

string $patterns

The patterns.

_getRegExpableSearchString()

_getRegExpableSearchString(string  $s) : string

Converts $s into a string that can be used with preg_match.

Parameters

string $s

String with wildcards ? and *.

Returns

string —

Search string converted to ., ? to ., etc.