SelectorUtils

<p>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

Methods

Retrieves the instance of the Singleton.

getInstance() 
static

Returns dependency information on these two files. 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.

isOutOfDate(\PhingFile $src, \PhingFile $target, integer $granularity) : boolean
static

Arguments

$src

\PhingFile

the original file

$target

\PhingFile

the file being compared against

$granularity

integer

the amount in seconds of slack we will give in determining out of dateness

Response

boolean

whether the target is out of date

Tests whether or not a string matches against a pattern.

match(string $pattern, string $str, boolean $isCaseSensitive = true) : boolean
static

The pattern may contain two special characters:
'*' means zero or more characters
'?' means one and only one character

Arguments

$pattern

string

The pattern to match against. Must not be null.

$str

string

The string which must be matched against the pattern. Must not be null.

$isCaseSensitive

boolean

Whether or not matching should be performed case sensitively.

Response

boolean

true if the string matches against the pattern, or false otherwise.

Tests whether or not a given path matches a given pattern.

matchPath(string $pattern, string $str, boolean $isCaseSensitive = true) : boolean
static

Arguments

$pattern

string

The pattern to match against. Must not be null.

$str

string

The path to match, as a String. Must not be null.

$isCaseSensitive

boolean

Whether or not matching should be performed case sensitively.

Response

boolean

true if the pattern matches against the string,

removeWhitespace

removeWhitespace(string $string) : string
static

Arguments

$string

string

Response

string

Properties

instance

instance : 
static

Type(s)