# classes/phing/tasks/ext/VersionTask.php

VersionTask

Increments a three-part version number from a given file and writes it back to the file. Incrementing is based on given releasetype, which can be one of Major, Minor and Bugfix. Resulting version number is also published under supplied property.

author
  Mike Wittje
package
  phing.tasks.ext
version
  $Id: VersionTask.php 1084 2011-05-06 09:55:25Z mrook $ $Rev $Revision: 1084 $ $Date: 2011-05-06 11:55:25 +0200 (Fri, 06 May 2011) $ $Author: mrook $

## \VersionTask
jump to top

VersionTask

Increments a three-part version number from a given file and writes it back to the file. Incrementing is based on given releasetype, which can be one of Major, Minor and Bugfix. Resulting version number is also published under supplied property.

Extends from
  \Task
author
  Mike Wittje
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.tasks.ext
version
  $Id: VersionTask.php 1084 2011-05-06 09:55:25Z mrook $ $Rev $Revision: 1084 $ $Date: 2011-05-06 11:55:25 +0200 (Fri, 06 May 2011) $ $Author: mrook $

### Constants

`RELEASETYPE_MAJOR = 'MAJOR'`

`RELEASETYPE_MINOR = 'MINOR'`

`RELEASETYPE_BUGFIX = 'BUGFIX'`

### Properties

`\PhingFile $file= ''`

Property for File

file
Details

Type
  \PhingFile

`string $property= ''`

Property to be set

Details

Type
  string

`string $releasetype= ''`

Property for Releasetype

Details

Type
  string

### Methods

`checkFile( ) : void`
checks file attribute
Details

throws

`checkProperty( ) : void`
checks property attribute
Details

throws

`checkReleasetype( ) : void`
checks releasetype attribute
Details

throws

`getVersion( string $filecontent ) : string`
Returns new version number corresponding to Release type
Parameters

Name | Type | Description
--- | --- | ---
$filecontent | string |

Returns

Type | Description
--- | ---
string |

`main( ) : void`
Main-Method for the Task
Details

throws

`setFile( \PhingFile $file ) :`
Set Property for File containing versioninformation
Parameters

Name | Type | Description
--- | --- | ---
$file | \PhingFile |

`setProperty( $property ) : void`
Set name of property to be set
Parameters

Name | Type | Description
--- | --- | ---
$property |  |

`setReleasetype( string $releasetype ) :`
Set Property for Releasetype (Minor, Major, Bugfix)
Parameters

Name | Type | Description
--- | --- | ---
$releasetype | string |

Documentation was generated by DocBlox 0.13.1.