class Connection implements ConnectionInterface (View source)

Methods

__construct($name, $host, $username, array $auth, GatewayInterface $gateway = null)

Create a new SSH connection instance.

void
define( string $task, string|array $commands)

Define a set of commands as a task.

void
task( string $task, Closure $callback = null)

Run a task against the connection.

void
run( string|array $commands, Closure $callback = null)

Run a set of commands against the connection.

void
get( string $remote, string $local)

Download the contents of a remote file.

string
getString( string $remote)

Get the contents of a remote file.

void
put( string $local, string $remote)

Upload a local file to the server.

void
putString( string $remote, string $contents)

Upload a string to to the given file on the server.

void
display( string $line)

Display the given line using the default output.

int|bool
status()

Get the exit status of the last command.

getGateway()

Get the gateway implementation.

OutputInterface
getOutput()

Get the output implementation for the connection.

void
setOutput( OutputInterface $output)

Set the output implementation.

Details

at line line 62
__construct($name, $host, $username, array $auth, GatewayInterface $gateway = null)

Create a new SSH connection instance.

Parameters

$name
$host
$username
array $auth
GatewayInterface $gateway

at line line 77
void define( string $task, string|array $commands)

Define a set of commands as a task.

Parameters

string $task
string|array $commands

Return Value

void

at line line 89
void task( string $task, Closure $callback = null)

Run a task against the connection.

Parameters

string $task
Closure $callback

Return Value

void

at line line 104
void run( string|array $commands, Closure $callback = null)

Run a set of commands against the connection.

Parameters

string|array $commands
Closure $callback

Return Value

void

at line line 133
void get( string $remote, string $local)

Download the contents of a remote file.

Parameters

string $remote
string $local

Return Value

void

at line line 144
string getString( string $remote)

Get the contents of a remote file.

Parameters

string $remote

Return Value

string

at line line 156
void put( string $local, string $remote)

Upload a local file to the server.

Parameters

string $local
string $remote

Return Value

void

at line line 168
void putString( string $remote, string $contents)

Upload a string to to the given file on the server.

Parameters

string $remote
string $contents

Return Value

void

at line line 179
void display( string $line)

Display the given line using the default output.

Parameters

string $line

Return Value

void

at line line 217
int|bool status()

Get the exit status of the last command.

Return Value

int|bool

at line line 229
GatewayInterface getGateway()

Get the gateway implementation.

Return Value

GatewayInterface

Exceptions

RuntimeException

at line line 244
OutputInterface getOutput()

Get the output implementation for the connection.

Return Value

OutputInterface

at line line 257
void setOutput( OutputInterface $output)

Set the output implementation.

Parameters

OutputInterface $output

Return Value

void