# tasks/system/CvsTask.php

## \CvsTask
jump to top

Package: phing\tasks\system

Task for performing CVS operations.

NOTE: This implementation has been moved here from Cvs.java with the addition of some accessors for extensibility. Another task can extend this with some customized output processing.

Parent(s)
  \Task < \ProjectComponent
Author
  Hans Lellelid (Phing)
Author
  costin@dnt.ro (Ant)
Author
  stefano@apache.org (Ant)
Author
  Wolfgang Werner (Ant)
Author
  Kevin Ross (Ant)
Copyright
  2001,2002 THYRELL. All rights reserved
Version
  $Revision: 1311 $

### Constants

`DEFAULT_COMPRESSION_LEVEL = 3`

Default compression level to use, if compression is enabled via setCompression( true ).

### Properties

`$cmd= ''`
Details

Type

`$command= 'null'`

the CVS command to execute.

Default value `null` Details

Type

`array $commandlines= 'array()'`

List of Commandline children

Commandline[]
Default value `array()`Details

Type
  array

`$compression= '0'`

compression level to use.

Default value `0` Details

Type

`$cvsModule= ''`

the package/module to check out.

Details

Type

`$cvsRoot= ''`

the CVSROOT variable.

Details

Type

`$cvsRsh= ''`

the CVS_RSH variable.

Details

Type

`$default_command= '"checkout"'`
static

the default command.

Default value`"checkout"`Details

Type

`string $description= ''`
inherited

description of the taskInherited from: \Task::$description
Details

Type
  string
Inherited_from
  \Task::$description

`\File $dest= ''`

the directory where the checked out files should be placed.

Details

Type
  \File

`$error= ''`
Details

Type

`boolean $failOnError= 'false'`

If true it will stop the build if cvs exits with error.

Default is false. (Iulian)

Default value `false` Details

Type
  boolean

`\Location $location= ''`
inherited

stored buildfile locationInherited from: \Task::$location
Details

Type
  \Location
Inherited_from
  \Task::$location

`$noexec= 'false'`

report only, don't change any files.

Default value `false` Details

Type

`$output= ''`
Details

Type

`\File $passFile= 'null'`

CVS password file

Default value `null` Details

Type
  \File

`$port= '0'`

CVS port

Default value `0` Details

Type

`\Project $project= 'null'`
inherited

Holds a reference to the project that a project component (a task, a target, etc.) belongs to

A reference to the current project instanceInherited from: \ProjectComponent::$project
Default value `null` Details

Type
  \Project
Inherited_from
  \ProjectComponent::$project

`$quiet= 'false'`

suppress information messages.

Default value `false` Details

Type

`\Target $target= ''`
inherited

owning Target objectInherited from: \Task::$target
Details

Type
  \Target
Inherited_from
  \Task::$target

`string $taskName= ''`
inherited

Taskname for loggerInherited from: \Task::$taskName
Details

Type
  string
Inherited_from
  \Task::$taskName

`string $taskType= ''`
inherited

internal taskname (req)Inherited from: \Task::$taskType
Details

Type
  string
Inherited_from
  \Task::$taskType

`\RuntimeConfigurable $wrapper= ''`
inherited

wrapper of the taskInherited from: \Task::$wrapper
Details

Type
  \RuntimeConfigurable
Inherited_from
  \Task::$wrapper

### Methods

`addConfiguredCommandline( \insertAtStart $c, $insertAtStart = false ) : void`

Configures and adds the given Commandline.

Parameters

Name | Type | Description
--- | --- | ---
$c | \insertAtStart | If true, c is
$insertAtStart |  |

`appendCommandArgument( $arg ) : void`

This needs to be public to allow configuration of commands externally.

Parameters

Name | Type | Description
--- | --- | ---
$arg |  |

`configureCommandline( $c ) : string`

Configure a commandline element for things like cvsRoot, quiet, etc.

Parameters

Name | Type | Description
--- | --- | ---
$c |  |

Returns

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

`getCommand( ) : void`

`getCvsRoot( ) : void`

`getCvsRsh( ) : void`

`getDescription( ) : string`
inherited

Returns the textual description of the task

Inherited from: \Task::getDescription()
Returns

Type | Description
--- | ---
string | The text description of the task

`getDest( ) : void`

`getLocation( ) : \Location`
inherited

Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.

Inherited from: \Task::getLocation()
Returns

Type | Description
--- | ---
\Location | The location object describing the position of this task within the buildfile.

`getModule( ) : void`

`getOwningTarget( ) : \Target`
inherited

Returns the owning target of this task.

Inherited from: \Task::getOwningTarget()
Returns

Type | Description
--- | ---
\Target | The target object that owns this task

`getPassFile( ) : \File`

Returns

Type | Description
--- | ---
\File |

`getPort( ) : int`

Returns

Type | Description
--- | ---
int |

`getProject( ) : \Project`
inherited

Returns a reference to current project

Inherited from: \ProjectComponent::getProject()
Returns

Type | Description
--- | ---
\Project | Reference to current porject object

`getRegisterSlot( $slotName ) : void`
inherited

Returns a name

Inherited from: \Task::getRegisterSlot()
Parameters

Name | Type | Description
--- | --- | ---
$slotName |  |

`getRuntimeConfigurableWrapper( ) : \RuntimeConfigurable`
inherited

Returns the wrapper object for runtime configuration

Inherited from: \Task::getRuntimeConfigurableWrapper()
Returns

Type | Description
--- | ---
\RuntimeConfigurable | The wrapper object used by this task

`getTaskName( ) : string`
inherited

Returns the name of task, used only for log messages

Inherited from: \Task::getTaskName()
Returns

Type | Description
--- | ---
string | Name of this task

`getTaskType( ) : string`
inherited

Returns the name of the task under which it was invoked, usually the XML tagname

Inherited from: \Task::getTaskType()
Returns

Type | Description
--- | ---
string | The type of this task (XML Tag)

`init( ) : void`

Called by the parser to let the task initialize properly.

Should throw a BuildException if something goes wrong with the build

This is abstract here, but may not be overloaded by subclasses.

Throws

Exception | Description
--- | ---
\BuildException |

`log( string $msg, integer $level = Project::MSG_INFO ) : void`
inherited

Provides a project level log event to the task.

Inherited from: \Task::log()

@param string $msg The message to be logged.

Parameters

Name | Type | Description
--- | --- | ---
$msg | string | The message to log
$level | integer | The priority of the message

Details

See
  \BuildEvent
See
  \BuildListener

`main( ) : void`

Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running phing target1 target2 will run all tasks in target3 twice.

Should throw a BuildException if someting goes wrong with the build

This is abstract here. Must be overloaded by real tasks.

Throws

Exception | Description
--- | ---
\BuildException |

`maybeConfigure( ) : void`
inherited

Configure this task if it hasn't been done already.

Inherited from: \Task::maybeConfigure()
`perform( ) : void`
inherited

Perfrom this task

Inherited from: \Task::perform()
`removeCommandline( $c ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$c |  |

`runCommand( \Commandline $toExecute ) : void`

Sets up the environment for toExecute and then runs it.

Parameters

Name | Type | Description
--- | --- | ---
$toExecute | \Commandline |

Throws

Exception | Description
--- | ---
\BuildException |

`setCommand( string $c ) : void`

The CVS command to execute.

Parameters

Name | Type | Description
--- | --- | ---
$c | string |

`setCompression( boolean $usecomp ) : void`

If true, this is the same as compressionlevel="3".

Parameters

Name | Type | Description
--- | --- | ---
$usecomp | boolean | If true, turns on compression using default level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL.

`setCompressionLevel( int $level ) : void`

If set to a value 1-9 it adds -zN to the cvs command line, else it disables compression.

Parameters

Name | Type | Description
--- | --- | ---
$level | int |

`setCvsRoot( string $root ) : void`

The CVSROOT variable.

Parameters

Name | Type | Description
--- | --- | ---
$root | string |

`setCvsRsh( $rsh ) : void`

The CVS_RSH variable.

Parameters

Name | Type | Description
--- | --- | ---
$rsh |  | rsh

`setDate( $p ) : void`

Use the most recent revision no later than the given date.

Parameters

Name | Type | Description
--- | --- | ---
$p |  | p

`setDescription( string $desc ) : void`
inherited

Sets a textual description of the task

Inherited from: \Task::setDescription()
Parameters

Name | Type | Description
--- | --- | ---
$desc | string | The text describing the task

`setDest( \PhingFile $dest ) : void`

The directory where the checked out files should be placed.

Parameters

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

`setError( $f ) : void`

File to which error output should be written.

Parameters

Name | Type | Description
--- | --- | ---
$f |  |

`setFailOnError( boolean $failOnError ) : void`

Stop the build process if the command exits with a return code other than 0.

Defaults to false.

Parameters

Name | Type | Description
--- | --- | ---
$failOnError | boolean |

`setLocation( \Location $location ) : void`
inherited

Sets the location within the buildfile this task occurs. Called by the parser to set location information.

Inherited from: \Task::setLocation()
Parameters

Name | Type | Description
--- | --- | ---
$location | \Location | The location object describing the position of this task within the buildfile.

`setModule( $m ) : void`

The package/module to operate upon.

Parameters

Name | Type | Description
--- | --- | ---
$m |  |

`setNoexec( boolean $ne ) : void`

If true, report only and don't change any files.

Parameters

Name | Type | Description
--- | --- | ---
$ne | boolean |

`setOutput( $f ) : void`

File to which output should be written.

Parameters

Name | Type | Description
--- | --- | ---
$f |  |

`setOwningTarget( \Target $target ) : void`
inherited

Sets the owning target this task belongs to.

Inherited from: \Task::setOwningTarget()
Parameters

Name | Type | Description
--- | --- | ---
$target | \Target | Reference to owning target

`setPassfile( $passFile ) : void`

Password file to read passwords from.

Parameters

Name | Type | Description
--- | --- | ---
$passFile |  | passFile

`setPort( int $port ) : void`

Port used by CVS to communicate with the server.

Parameters

Name | Type | Description
--- | --- | ---
$port | int |

`setProject( \Project $project ) : void`
inherited

References the project to the current component.

Inherited from: \ProjectComponent::setProject()
Parameters

Name | Type | Description
--- | --- | ---
$project | \Project | The reference to the current project

`setQuiet( boolean $q ) : void`

If true, suppress informational messages.

Parameters

Name | Type | Description
--- | --- | ---
$q | boolean |

`setRuntimeConfigurableWrapper( \RuntimeConfigurable $wrapper ) : void`
inherited

Sets the wrapper object this task should use for runtime configurable elements.

Inherited from: \Task::setRuntimeConfigurableWrapper()
Parameters

Name | Type | Description
--- | --- | ---
$wrapper | \RuntimeConfigurable | The wrapper object this task should use

`setTag( string $p ) : void`

The tag of the package/module to operate upon.

Parameters

Name | Type | Description
--- | --- | ---
$p | string |

`setTaskName( $name ) : string`
inherited

Sets the name of this task for log messages

Inherited from: \Task::setTaskName()
Parameters

Name | Type | Description
--- | --- | ---
$name |  |

Returns

Type | Description
--- | ---
string | A string representing the name of this task for log

`setTaskType( string $name ) : void`
inherited

Sets the type of the task. Usually this is the name of the XML tag

Inherited from: \Task::setTaskType()
Parameters

Name | Type | Description
--- | --- | ---
$name | string | The type of this task (XML Tag)

Documentation was generated by DocBlox 0.15.1.