phing-types-selectors
[ class tree: phing-types-selectors ] [ index: phing-types-selectors ] [ all elements ]

Class: SelectorUtils

Source Location: /types/selectors/SelectorUtils.php

Class Overview


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


Author(s):

  • Hans Lellelid, hans@xmpl.org (Phing)
  • Arnout J. Kuiper, ajkuiper@wxs.nl (Ant)
  • Magesh Umasankar
  • Bruce Atherton, bruce@callenish.com (Ant)

Methods



Class Details

[line 39]
<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.

</p> <p>This is a Singleton.</p>




Tags:

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)


[ Top ]


Class Methods


static method getInstance [line 46]

static void getInstance( )

Retrieves the instance of the Singleton.



Tags:

access:  public


[ Top ]

static method isOutOfDate [line 183]

static whether isOutOfDate( $src, $target, int $granularity)

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.




Tags:

return:  the target is out of date
access:  public


Parameters:

PhingFile   $src   the original file
PhingFile   $target   the file being compared against
int   $granularity   the amount in seconds of slack we will give in determining out of dateness

[ Top ]

static method match [line 161]

static true match( pattern $pattern, str $str, [isCaseSensitive $isCaseSensitive = true])

Tests whether or not a string matches against a pattern.

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




Tags:

return:  if the string matches against the pattern, or
  1. false
otherwise.
access:  public


Parameters:

pattern   $pattern   The pattern to match against. Must not be
  1. null
.
str   $str   The string which must be matched against the pattern. Must not be
  1. null
.
isCaseSensitive   $isCaseSensitive   Whether or not matching should be performed case sensitively.

[ Top ]

static method matchPath [line 129]

static true matchPath( pattern $pattern, str $str, [isCaseSensitive $isCaseSensitive = true])

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



Tags:

return:  if the pattern matches against the string, or
  1. false
otherwise.
access:  public


Parameters:

pattern   $pattern   The pattern to match against. Must not be
  1. null
.
str   $str   The path to match, as a String. Must not be
  1. null
.
isCaseSensitive   $isCaseSensitive   Whether or not matching should be performed case sensitively.

[ Top ]

static method matchPatternStart [line 71]

static whether matchPatternStart( pattern $pattern, str $str, [isCaseSensitive $isCaseSensitive = true])

Tests whether or not a given path matches the start of a given pattern up to the first "**".

This is not a general purpose test and should only be used if you can live with false positives. For example,

  1. pattern=**a
and
  1. str=b
will yield
  1. true
.




Tags:

return:  or not a given path matches the start of a given pattern up to the first "**".
access:  public


Parameters:

pattern   $pattern   The pattern to match against. Must not be
  1. null
.
str   $str   The path to match, as a String. Must not be
  1. null
.
isCaseSensitive   $isCaseSensitive   Whether or not matching should be performed case sensitively.

[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:51:58 +0200 by phpDocumentor 1.4.3