types/selectors/DateSelector.php
Selector that chooses files based on their last modified date. Ant uses millisecond precision (thanks to Java); PHP is forced to use only seconds precision.
- Author
- Hans Lellelid
(Phing) - Author
- Bruce Atherton
(Ant) - Package
- phing.types.selectors
- Version
- $Revision: 1207 $
\DateSelector
Selector that chooses files based on their last modified date. Ant uses millisecond precision (thanks to Java); PHP is forced to use only seconds precision.
- Parent(s)
- \BaseExtendSelector < \BaseSelector < \DataType < \ProjectComponent
- Author
- Hans Lellelid
(Phing) - Author
- Bruce Atherton
(Ant) - Version
- $Revision: 1207 $
Constants
Properties
Methods

isSelected(
\PhingFile $basedir, string $filename, \PhingFile $file
)
:
booleanThe 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 | \PhingFile | the base directory the scan is being done from |
| $filename | string | is the name of the file to check |
| $file | \PhingFile | is a PhingFile object the selector can use |
| Type | Description |
|---|---|
| boolean | Whether the file should be selected or not |

setCheckdirs(
boolean $includeDirs
)
:
voidShould we be checking dates on directories?
| Name | Type | Description |
|---|---|---|
| $includeDirs | boolean | whether to check the timestamp on directories |

setDatetime(
string $dateTime
)
:
voidSets the date. The user must supply it in MM/DD/YYYY HH:MM AM_PM format
| Name | Type | Description |
|---|---|---|
| $dateTime | string | a string in MM/DD/YYYY HH:MM AM_PM format |

setGranularity(
int $granularity
)
:
voidSets the number of milliseconds leeway we will give before we consider a file not to have matched a date.
| Name | Type | Description |
|---|---|---|
| $granularity | int |

setParameters(
array $parameters
)
:
voidWhen using this as a custom selector, this method will be called.
It translates each parameter into the appropriate setXXX() call.
| Name | Type | Description |
|---|---|---|
| $parameters | array | the complete set of parameters for this selector |

setSeconds(
int $seconds
)
:
voidFor users that prefer to express time in seconds since 1970
| Name | Type | Description |
|---|---|---|
| $seconds | int | the time to compare file's last modified date to, expressed in milliseconds |

setWhen(
string $cmp
)
:
voidSets the type of comparison to be done on the file's last modified date.
| Name | Type | Description |
|---|---|---|
| $cmp | string | The comparison to perform |