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

Copy files to and from a remote host using scp.

author
  Michiel Rook
author
  Johan Van den Brande
package
  phing.tasks.ext
version
  $Id: ScpTask.php 1070 2011-03-25 14:35:06Z mrook $

## \ScpTask
jump to top

Copy files to and from a remote host using scp.

Use {@link Project#createTask} to register a new Task.

Extends from
  \Task
author
  Michiel Rook
author
  Johan Van den Brande
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.tasks.ext
version
  $Id: ScpTask.php 1070 2011-03-25 14:35:06Z mrook $

### Properties

`$autocreate= 'true'`
Default value `true` Details

Type

`$connection= 'null'`
Default value `null` Details

Type

`$count= '0'`
Default value `0` Details

Type

`$fetch= 'false'`
Default value `false` Details

Type

`$file= ''`
Details

Type

`$filesets= 'array'`
Default value `array` Details

Type

`$host= ''`
Details

Type

`$localEndpoint= ''`
Details

Type

`$logLevel= 'Project'`
Default value `Project` Details

Type

`$mode= 'null'`
Default value `null` Details

Type

`$password= ''`
Details

Type

`$port= '22'`
Default value `22` Details

Type

`$privkeyfile= ''`
Details

Type

`$privkeyfilepassphrase= ''`
Details

Type

`$pubkeyfile= ''`
Details

Type

`$remoteEndpoint= ''`
Details

Type

`$sftp= 'null'`
Default value `null` Details

Type

`$todir= ''`
Details

Type

`$username= ''`
Details

Type

### Methods

`copyFile( $local, $remote ) :`
Parameters

Name | Type | Description
--- | --- | ---
$local |  |
$remote |  |

`createFileSet( ) : \FileSet`
Nested creator, creates a FileSet for this task
Returns

Type | Description
--- | ---
\FileSet |

`getAutocreate( ) :`
Returns whether to autocreate remote directories
`getFetch( ) :`
Returns whether to send (default) or fetch files
`getFile( ) :`
Returns local filename
`getHost( ) :`
Returns the remote host
`getMode( ) :`
Returns the mode value
`getPassword( ) :`
Returns the password
`getPort( ) :`
Returns the remote host port
`getPrivkeyfile( ) :`
Returns the private keyfile
`getPrivkeyfilepassphrase( $privkeyfilepassphrase ) :`
Returns the private keyfile passphrase
Parameters

Name | Type | Description
--- | --- | ---
$privkeyfilepassphrase |  |

`getPubkeyfile( ) :`
Returns the pubkeyfile
`getTodir( ) :`
Returns the destination directory
`getUsername( ) :`
Returns the username
`init( ) :`
`main( ) :`
`setAutocreate( $autocreate ) :`
Sets whether to autocreate remote directories
Parameters

Name | Type | Description
--- | --- | ---
$autocreate |  |

`setFetch( $fetch ) :`
Sets whether to send (default) or fetch files
Parameters

Name | Type | Description
--- | --- | ---
$fetch |  |

`setFile( $file ) :`
Sets local filename
Parameters

Name | Type | Description
--- | --- | ---
$file |  |

`setHost( $h ) :`
Sets the remote host
Parameters

Name | Type | Description
--- | --- | ---
$h |  |

`setLevel( string $level ) :`
Set level of log messages generated (default = verbose)
Parameters

Name | Type | Description
--- | --- | ---
$level | string |

`setMode( $value ) :`
Sets the mode value
Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setPassword( $password ) :`
Sets the password of the user to scp
Parameters

Name | Type | Description
--- | --- | ---
$password |  |

`setPort( $p ) :`
Sets the remote host port
Parameters

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

`setPrivkeyfile( $privkeyfile ) :`
Sets the private key file of the user to scp
Parameters

Name | Type | Description
--- | --- | ---
$privkeyfile |  |

`setPrivkeyfilepassphrase( $privkeyfilepassphrase ) :`
Sets the private key file passphrase of the user to scp
Parameters

Name | Type | Description
--- | --- | ---
$privkeyfilepassphrase |  |

`setPubkeyfile( $pubkeyfile ) :`
Sets the public key file of the user to scp
Parameters

Name | Type | Description
--- | --- | ---
$pubkeyfile |  |

`setTodir( $todir ) :`
Set destination directory
Parameters

Name | Type | Description
--- | --- | ---
$todir |  |

`setUsername( $username ) :`
Sets the username of the user to scp
Parameters

Name | Type | Description
--- | --- | ---
$username |  |

Documentation was generated by DocBlox 0.13.1.