Connection
class Connection implements ConnectionInterface (View source)
Properties
protected GatewayInterface | $gateway | The SSH gateway implementation. | |
protected string | $name | The name of the connection. | |
protected string | $host | The host name of the server. | |
protected string | $username | The username for the connection. | |
protected array | $tasks | All of the defined tasks. | |
protected OutputInterface | $output | The output implementation for the connection. |
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. | |
string | formatCommands(string|array $commands) Format the given command set. | |
Closure | getCallback(Closure|null $callback) Get the display callback for the connection. | |
int|bool | status() Get the exit status of the last command. | |
GatewayInterface | getGateway() Get the gateway implementation. | |
OutputInterface | getOutput() Get the output implementation for the connection. | |
void | setOutput(OutputInterface $output) Set the output implementation. |
Details
__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.
protected string formatCommands(string|array $commands)
Format the given command set.
int|bool status()
Get the exit status of the last command.
GatewayInterface getGateway()
Get the gateway implementation.
OutputInterface getOutput()
Get the output implementation for the connection.
void setOutput(OutputInterface $output)
Set the output implementation.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.5/Illuminate/Remote/Connection.html