types/selectors/PresentSelector.php

Show: inherited
Table of Contents

Selector that filters files based on whether they appear in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).

Author
Hans Lellelid (Phing)  
Author
Bruce Atherton (Ant)  
Package
phing.types.selectors  

\PresentSelector

Package: phing\types\selectors

Selector that filters files based on whether they appear in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).

Parent(s)
\BaseSelector < \DataType < \ProjectComponent
Author
Hans Lellelid (Phing)  
Author
Bruce Atherton (Ant)  

Properties

Propertyprivate  $destmustexist= 'true'
Default valuetrueDetails
Type
n/a
Propertyprivate  $filePresence= 'array("srconly"'
static
Default valuearray("srconly"Details
Type
n/a
Propertyprivate  $map= 'null'
Default valuenullDetails
Type
n/a
Propertyprivate  $mapperElement= 'null'
Default valuenullDetails
Type
n/a
Propertyprivate  $targetdir= 'null'
Default valuenullDetails
Type
n/a

Methods

methodpubliccircularReference( ) : void

methodpubliccreateMapper( ) : void

Defines the FileNameMapper to use (nested mapper element).

Throws
Exception Description
\BuildException
methodpublicdieOnCircularReference( ) : void

methodpublicgetCheckedRef( ) : void

methodpublicgetDescription( ) : void

methodpublicgetError( ) : void

methodpublicgetProject( ) : void

methodpublicisReference( ) : void

methodpublicisSelected( \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

is a PhingFile object the selector can use

Returns
Type Description
\whether the file should be selected or not
methodpubliclog( ) : void

methodpublicnoChildrenAllowed( ) : void

methodpublicparsingComplete( ) : void

methodpublicsetDescription( ) : void

methodpublicsetError( ) : void

methodpublicsetPresent( string $fp ) : void

This sets whether to select a file if its dest file is present.

It could be a

negate

boolean, but by doing things this way, we get some documentation on how the system works. A user looking at the documentation should clearly understand that the ONLY files whose presence is being tested are those that already exist in the source directory, hence the lack of a

destonly

option.

Parameters
Name Type Description
$fp string

An attribute set to either srconly or both.

methodpublicsetProject( ) : void

methodpublicsetRefid( ) : void

methodpublicsetTargetdir( \targetdir $targetdir ) : void

The name of the file or directory which is checked for matching files.

Parameters
Name Type Description
$targetdir \targetdir

the directory to scan looking for matching files.

methodpublictoString( ) : void

methodpublictooManyAttributes( ) : void

methodpublicvalidate( ) : void

methodpublicverifySettings( ) : void

Checks to make sure all settings are kosher. In this case, it means that the targetdir attribute has been set and we have a mapper.

Documentation was generated by DocBlox 0.17.1.