classes/phing/types/selectors/ContainsSelector.php

Selector that filters files based on whether they contain a particular string.

author
Hans Lellelid (Phing)
author
Bruce Atherton (Ant)
package
phing.types.selectors

\ContainsSelector

Selector that filters files based on whether they contain a particular string.

It provides support for gathering the parameters together as well as for assigning an error message and throwing a build exception if an error is detected.

Extends from
\BaseExtendSelector
author
Hans Lellelid (Phing)
author
Bruce Atherton (Ant)
package
phing.types.selectors
version
$Revision: 526 $

Constants

Constant  CONTAINS_KEY = 'text'
Constant  CASE_KEY = 'casesensitive'

Properties

Propertyprivate  $casesensitive= 'true'
Default valuetrueDetails
Type
Propertyprivate  $contains= 'null'
Default valuenullDetails
Type

Methods

methodpublic  isSelected( \basedir $basedir, \filename $filename, \file $file ) : \whether
The heart of the matter. This is where the selector gets to decide on the inclusion of a file in a particular fileset.
Parameters
Name Type Description
$basedir \basedir the base directory the scan is being done from
$filename \filename is the name of the file to check
$file \file a PhingFile object the selector can use
Returns
Type Description
\whether
methodpublic  setCasesensitive( boolean $casesensitive ) :
Whether to ignore case in the string being searched.
Parameters
Name Type Description
$casesensitive boolean whether to pay attention to case sensitivity
methodpublic  setParameters( array $parameters ) :
When using this as a custom selector, this method will be called.

It translates each parameter into the appropriate setXXX() call.

Parameters
Name Type Description
$parameters array the complete set of parameters for this selector
methodpublic  setText( string $contains ) :
The string to search for within a file.
Parameters
Name Type Description
$contains string the string that a file must contain to be selected.
methodpublic  toString( ) :
methodpublic  verifySettings( ) :
Checks to make sure all settings are kosher. In this case, it means that the pattern attribute has been set.
Documentation was generated by DocBlox 0.13.1.