This is a utility class used by selectors and DirectoryScanner.
The functionality more properly belongs just to selectors, but unfortunately DirectoryScanner exposed these as protected methods. Thus we have to support any subclasses of DirectoryScanner that may access these methods.
This is a Singleton.
| author | Hans Lellelid, hans@xmpl.org (Phing) |
|---|---|
| author | Arnout J. Kuiper, ajkuiper@wxs.nl (Ant) |
| author | Magesh Umasankar |
| author | Bruce Atherton, bruce@callenish.com (Ant) |
| package | phing.types.selectors |
getInstance()
isOutOfDate(\PhingFile $src, \PhingFile $target, int $granularity) : \whether
If src has been modified later than target, it returns true. If target doesn't exist, it likewise returns true. Otherwise, target is newer than src and is not out of date, thus the method returns false. It also returns false if the src file doesn't even exist, since how could the target then be out of date.
intthe amount in seconds of slack we will give in determining out of dateness
\whetherthe target is out of datematch(\pattern $pattern, \str $str, \isCaseSensitive $isCaseSensitive) : \<code>true</code>
The pattern may contain two special characters:
'*' means zero or more characters
'?' means one and only one character
\patternThe pattern to match against.
Must not be null.
\strThe string which must be matched against the pattern.
Must not be null.
\isCaseSensitiveWhether or not matching should be performed case sensitively.
\<code>true</code>if the string matches against the pattern,
or false otherwise.matchPath(\pattern $pattern, \str $str, \isCaseSensitive $isCaseSensitive) : \<code>true</code>
\patternThe pattern to match against. Must not be
null.
\strThe path to match, as a String. Must not be
null.
\isCaseSensitiveWhether or not matching should be performed case sensitively.
\<code>true</code>if the pattern matches against the string,
or false otherwise.matchPatternStart(\pattern $pattern, \str $str, \isCaseSensitive $isCaseSensitive) : \whether
<
p> This is not a general purpose test and should only be used if you can live with false positives. For example,
pattern=**\a
and
str=b
will yield
true
.
\patternThe pattern to match against. Must not be
null.
\strThe path to match, as a String. Must not be
null.
\isCaseSensitiveWhether or not matching should be performed case sensitively.
\whetheror not a given path matches the start of a given
pattern up to the first "**".$instance