classes/phing/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.

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: 1207 $

Constants

Constant  MILLIS_KEY = 'millis'
Constant  DATETIME_KEY = 'datetime'
Constant  CHECKDIRS_KEY = 'checkdirs'
Constant  GRANULARITY_KEY = 'granularity'
Constant  WHEN_KEY = 'when'

Properties

Propertyprivate  $cmp= '2'
Default value2Details
Type
Propertyprivate  $dateTime= 'null'
Default valuenullDetails
Type
Propertyprivate  $granularity= '0'
Default value0Details
Type
Propertyprivate  $includeDirs= 'false'
Default valuefalseDetails
Type
Propertyprivate  $seconds= ''
Details
Type
Propertyprivate  $timeComparisons= 'array'
static
Default valuearrayDetails
Type

Methods

methodpublic  __construct( ) :
methodpublic  getSeconds( ) :
Returns the seconds value the selector is set for.
methodpublic  isSelected( \PhingFile $basedir, string $filename, \PhingFile $file ) : boolean
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 \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
Returns
Type Description
boolean
methodpublic  setCheckdirs( boolean $includeDirs ) :
Should we be checking dates on directories?
Parameters
Name Type Description
$includeDirs boolean whether to check the timestamp on directories
methodpublic  setDatetime( string $dateTime ) :
Sets the date. The user must supply it in MM/DD/YYYY HH:MM AM_PM format
Parameters
Name Type Description
$dateTime string

a string in MM/DD/YYYY HH:MM AM_PM format

methodpublic  setGranularity( int $granularity ) :
Sets the number of milliseconds leeway we will give before we consider a file not to have matched a date.
Parameters
Name Type Description
$granularity int
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  setSeconds( int $seconds ) :
For users that prefer to express time in seconds since 1970
Parameters
Name Type Description
$seconds int

the time to compare file's last modified date to, expressed in milliseconds

methodpublic  setWhen( string $cmp ) :
Sets the type of comparison to be done on the file's last modified date.
Parameters
Name Type Description
$cmp string The comparison to perform
methodpublic  toString( ) :
methodpublic  verifySettings( ) :
This is a consistency check to ensure the selector's required values have been set.
Documentation was generated by DocBlox 0.13.1.