types/selectors/PresentSelector.php
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
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
Methods

createMapper(
)
:
voidDefines the FileNameMapper to use (nested mapper element).
| Exception | Description |
|---|---|
| \BuildException |

isSelected(
\basedir $basedir, \filename $filename, \file $file
)
:
\whetherThe heart of the matter. This is where the selector gets to decide on the inclusion of a file in a particular fileset.
| 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 |
| Type | Description |
|---|---|
| \whether | the file should be selected or not |

setPresent(
string $fp
)
:
voidThis 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.
| Name | Type | Description |
|---|---|---|
| $fp | string | An attribute set to either |

setTargetdir(
\targetdir $targetdir
)
:
voidThe name of the file or directory which is checked for matching files.
| Name | Type | Description |
|---|---|---|
| $targetdir | \targetdir | the directory to scan looking for matching files. |