Permalink
Browse files

allow port on remote host.

  • Loading branch information...
taylorotwell committed Oct 2, 2013
1 parent ad5e594 commit 3f7c47cb243be3ba201bf75c6c0c38e7b96b43b3
Showing with 30 additions and 2 deletions.
  1. +30 −2 src/Illuminate/Remote/SecLibGateway.php
@@ -13,6 +13,13 @@ class SecLibGateway implements GatewayInterface {
*/
protected $host;
/**
* The SSH port on the server.
*
* @var int
*/
protected $port = 22;
/**
* The authentication credential set.
*
@@ -36,10 +43,31 @@ class SecLibGateway implements GatewayInterface {
*/
public function __construct($host, array $auth, Filesystem $files)
{
$this->host = $host;
$this->auth = $auth;
$this->files = $files;
$this->connection = new Net_SFTP($this->host);
$this->setHostAndPort($host);
$this->connection = new Net_SFTP($this->host, $this->port);
}
/**
* Set the host and port from a full host string.
*
* @param string $host
* @return void
*/
protected function setHostAndPort($host)
{
if ( ! str_contains($host, ':'))
{
$this->host = $host;
}
else
{
list($this->host, $this->post) = explode($host, ':');
$this->port = (int) $this->port;
}
}
/**

0 comments on commit 3f7c47c

Please sign in to comment.