phing-types-selecctors

# Class: DateSelector Source Location: /types/selectors/DateSelector.php
### Class Overview
    ProjectComponent
       |
       --DataType
          |
          --BaseSelector
             |
             --BaseExtendSelector
                |
                --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. #### Author(s): Bruce Atherton <bruce@callenish.com> (Ant) Hans Lellelid <hans@xmpl.org> (Phing) #### Version: $Revision: 526 $ | ### Constants CHECKDIRS_KEY DATETIME_KEY GRANULARITY_KEY MILLIS_KEY WHEN_KEY | ### Methods __construct getSeconds isSelected setCheckdirs setDatetime setGranularity setParameters setSeconds setWhen toString verifySettings
### Inherited Variables #### Class: BaseExtendSelector BaseExtendSelector::$parameters #### Class: DataType DataType::$checked DataType::$description DataType::$ref #### Class: ProjectComponent ProjectComponent::$project | ### Inherited Methods #### Class: BaseExtendSelector BaseExtendSelector::getParameters() Allows access to the parameters gathered and set within the &lt;custom&gt; tag. BaseExtendSelector::setParameters() Set all the Parameters for this custom selector, collected by the ExtendSelector class. #### Class: BaseSelector BaseSelector::getError() Returns any error messages that have been set. BaseSelector::setError() Allows all selectors to indicate a setup error. Note that only the first error message is recorded. BaseSelector::validate() Subclasses can use this to throw the requisite exception in isSelected() in the case of an error condition. BaseSelector::verifySettings() <p>Subclasses can override this method to provide checking of their #### Class: DataType DataType::circularReference() Creates an exception that indicates the user has generated a loop of data types referencing each other. DataType::dieOnCircularReference() Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself). DataType::getCheckedRef() Performs the check for circular references and returns the referenced object. DataType::getDescription() Return the description for the current data type. DataType::isReference() Has the refid attribute of this element been set? DataType::noChildrenAllowed() Creates an exception that indicates that this XML element must not have child elements if the refid attribute is set. DataType::parsingComplete() Template method being called when the data type has been parsed completely. DataType::setDescription() Sets a description of the current data type. It will be useful in commenting what we are doing. DataType::setRefid() Set the value of the refid attribute. DataType::tooManyAttributes() Creates an exception that indicates that refid has to be the only attribute if it is set. #### Class: ProjectComponent ProjectComponent::getProject() Returns a reference to current project ProjectComponent::log() Logs a message with the given priority. ProjectComponent::setProject() References the project to the current component.
### Class Details [line 35] 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. #### Tags:
author: | Bruce Atherton <bruce@callenish.com> (Ant)
author: | Hans Lellelid <hans@xmpl.org> (Phing)
version: | $Revision: 526 $
[ Top ] ### Class Methods ### constructor __construct [line 49]
`DateSelector __construct( )`
#### Tags:
access: | public
[ Top ] ### method getSeconds [line 85]
`void getSeconds( )`
Returns the seconds value the selector is set for. #### Tags:
access: | public
[ Top ] ### method isSelected [line 198]
`boolean isSelected( $basedir, string $filename, $file)`
The heart of the matter. This is where the selector gets to decide on the inclusion of a file in a particular fileset. #### Tags:
return: | Whether the file should be selected or not
access: | public
#### Parameters:
PhingFile | $basedir | the base directory the scan is being done from
string | $filename | is the name of the file to check
PhingFile | $file | is a PhingFile object the selector can use
[ Top ] ### method setCheckdirs [line 112]
`void setCheckdirs( boolean $includeDirs)`
Should we be checking dates on directories? #### Tags:
access: | public
#### Parameters:
boolean | $includeDirs | whether to check the timestamp on directories
[ Top ] ### method setDatetime [line 95]
`void setDatetime( string $dateTime)`
Sets the date. The user must supply it in MM/DD/YYYY HH:MM AM_PM format #### Tags:
access: | public
#### Parameters:
string | $dateTime | a string in MM/DD/YYYY HH:MM AM_PM format
[ Top ] ### method setGranularity [line 121]
`void setGranularity( int $granularity)`
Sets the number of milliseconds leeway we will give before we consider a file not to have matched a date. #### Tags:
access: | public
#### Parameters:
int | $granularity |
[ Top ] ### method setParameters [line 146]
`void setParameters( array $parameters)`
When using this as a custom selector, this method will be called. It translates each parameter into the appropriate setXXX() call. #### Tags:
access: | public
Overrides BaseExtendSelector::setParameters() (Set all the Parameters for this custom selector, collected by the ExtendSelector class.) #### Parameters:
array | $parameters | the complete set of parameters for this selector
[ Top ] ### method setSeconds [line 78]
`void setSeconds( int $seconds)`
For users that prefer to express time in seconds since 1970 #### Tags:
access: | public
#### Parameters:
int | $seconds | the time to compare file's last modified date to, expressed in milliseconds
[ Top ] ### method setWhen [line 131]
`void setWhen( string $cmp)`
Sets the type of comparison to be done on the file's last modified date. #### Tags:
access: | public
#### Parameters:
string | $cmp | The comparison to perform
[ Top ] ### method toString [line 55]
`void toString( )`
#### Tags:
access: | public
[ Top ] ### method verifySettings [line 178]
`void verifySettings( )`
This is a consistency check to ensure the selector's required values have been set. #### Tags:
access: | public
Overrides BaseSelector::verifySettings() (<p>Subclasses can override this method to provide checking of their) [ Top ] ### Class Constants #### CHECKDIRS_KEY = "checkdirs" [line 44] [ Top ] #### DATETIME_KEY = "datetime" [line 43] [ Top ] #### GRANULARITY_KEY = "granularity" [line 45] [ Top ] #### MILLIS_KEY = "millis" [line 42] [ Top ] #### WHEN_KEY = "when" [line 46] [ Top ] Documentation generated on Mon, 19 Oct 2009 10:50:43 +0200 by phpDocumentor 1.4.3