classes/phing/types/PatternSet.php

\PatternSet

The patternset storage component. Carries all necessary data and methods for the patternset stuff.

This class handles the common description attribute and provides a default implementation for reference handling and checking for circular references that is appropriate for types that can not be nested inside elements of the same type (i.e. patternset but not path)

Extends from
\DataType
author
Andreas Aderhold, andi@binarycloud.com
package
phing.types
version
$Revision: 1097 $

Properties

Propertyprivate  $excludeList= 'array'
Default valuearrayDetails
Type
Propertyprivate  $excludesFileList= 'array'
Default valuearrayDetails
Type
Propertyprivate  $includeList= 'array'
Default valuearrayDetails
Type
Propertyprivate  $includesFileList= 'array'
Default valuearrayDetails
Type

Methods

methodprivate  addPatternToList( array $list ) : \PatternSetNameEntry
add a name entry to the given list
Parameters
Name Type Description
$list array List onto which the nameentry should be added
Returns
Type Description
\PatternSetNameEntry
methodpublic  append(  $other,  $p ) :
Adds the patterns of the other instance to this set.
Parameters
Name Type Description
$other
$p
methodpublic  createExclude( ) : \PatternSetNameEntry
Add a name entry on the exclude list
Returns
Type Description
\PatternSetNameEntry
Details
throws
methodpublic  createExcludesFile( ) : \PatternSetNameEntry
add a name entry on the exclude files list
Returns
Type Description
\PatternSetNameEntry
Details
throws
methodpublic  createInclude( ) : \PatternSetNameEntry
Add a name entry on the include list
Returns
Type Description
\PatternSetNameEntry
Details
throws
methodpublic  createIncludesFile( ) : \PatternSetNameEntry
Add a name entry on the include files list
Returns
Type Description
\PatternSetNameEntry
Details
throws
methodpublic  getExcludePatterns(  $p ) :
Returns the filtered exclude patterns.
Parameters
Name Type Description
$p
methodpublic  getIncludePatterns(  $p ) :
Returns the filtered include patterns.
Parameters
Name Type Description
$p
methodpublic  getRef(  $p ) :
Performs the check for circular references and returns the referenced PatternSet.
Parameters
Name Type Description
$p
methodpublic  hasPatterns( ) :
helper for FileSet.
methodprivate  makeArray(  $list,  $p ) :
Convert a array of PatternSetNameEntry elements into an array of Strings.
Parameters
Name Type Description
$list
$p
methodprivate  readFiles(  $p ) :
Read includesfile or excludesfile if not already done so.
Parameters
Name Type Description
$p
methodprivate  readPatterns(  $patternfile,  $patternlist,  $p ) :
Reads path matching patterns from a file and adds them to the includes or excludes list
Parameters
Name Type Description
$patternfile
$patternlist
$p
methodpublic  setExcludes( string $excludes ) : void
Sets the set of exclude patterns. Patterns may be separated by a comma or a space.
Parameters
Name Type Description
$excludes string the string containing the exclude patterns
Details
throws
methodpublic  setExcludesFile( \excludesFile $excludesFile ) :
Sets the name of the file containing the excludes patterns.
Parameters
Name Type Description
$excludesFile \excludesFile The file to fetch the exclude patterns from.
methodpublic  setIncludes( string $includes ) : void
Sets the set of include patterns. Patterns may be separated by a comma or a space.
Parameters
Name Type Description
$includes string the string containing the include patterns
Details
throws
methodpublic  setIncludesFile( \includesFile $includesFile ) :
Sets the name of the file containing the includes patterns.
Parameters
Name Type Description
$includesFile \includesFile The file to fetch the include patterns from.
methodpublic  setRefid(  $r ) :
Makes this instance in effect a reference to another PatternSet instance.

You must not set another attribute or nest elements inside this element if you make it a reference.

Parameters
Name Type Description
$r
methodpublic  toString( ) :

\PatternSetNameEntry

"Internal" class for holding an include/exclude pattern.

package
phing.types

Properties

Propertyprivatestring  $ifCond= ''

The if-condition property for this pattern to be applied.

Details
Type
string
Propertyprivatestring  $name= ''

The pattern.

Details
Type
string
Propertyprivatestring  $unlessCond= ''

The unless-condition property for this pattern to be applied.

Details
Type
string

Methods

methodpublic  evalName(  $project ) : string
Evaluates the pattern.
Parameters
Name Type Description
$project
Returns
Type Description
string
methodpublic  getName( ) : string
Get the pattern text.
Returns
Type Description
string
methodpublic  setIf( string $cond ) :
Sets an if-condition property for this pattern to match.
Parameters
Name Type Description
$cond string
methodpublic  setName( string $name ) :
Set the pattern text.
Parameters
Name Type Description
$name string The pattern
methodpublic  setPattern( string $pattern ) :
An alias for the setName() method.
Parameters
Name Type Description
$pattern string
Details
see
\setName()
methodpublic  setUnless( string $cond ) :
Sets an unless-condition property for this pattern to match.
Parameters
Name Type Description
$cond string
methodpublic  toString( ) : string
Gets a string representation of this pattern.
Returns
Type Description
string
methodpublic  valid( \Project $project ) : boolean
Checks whether pattern should be applied based on whether the if and unless properties are set in project.
Parameters
Name Type Description
$project \Project
Returns
Type Description
boolean
Documentation was generated by DocBlox 0.13.1.