Issue #2242405 by mikebarkas, jlbellido | alexpott: Fixed FileTransfer::connect is protected yet the implementations are public and this is relied upon.

8.0.x
Alex Pott 2014-07-10 11:22:27 +01:00
parent 2aa98311cf
commit 558ad0ce8a
4 changed files with 4 additions and 4 deletions

View File

@ -110,7 +110,7 @@ abstract class FileTransfer {
/** /**
* Connects to the server. * Connects to the server.
*/ */
abstract protected function connect(); abstract public function connect();
/** /**
* Copies a directory. * Copies a directory.

View File

@ -15,7 +15,7 @@ class Local extends FileTransfer implements ChmodInterface {
/** /**
* Implements Drupal\Core\FileTransfer\FileTransfer::connect(). * Implements Drupal\Core\FileTransfer\FileTransfer::connect().
*/ */
function connect() { public function connect() {
// No-op // No-op
} }

View File

@ -26,7 +26,7 @@ class SSH extends FileTransfer implements ChmodInterface {
/** /**
* Implements Drupal\Core\FileTransfer\FileTransfer::connect(). * Implements Drupal\Core\FileTransfer\FileTransfer::connect().
*/ */
function connect() { public function connect() {
$this->connection = @ssh2_connect($this->hostname, $this->port); $this->connection = @ssh2_connect($this->hostname, $this->port);
if (!$this->connection) { if (!$this->connection) {
throw new FileTransferException('SSH Connection failed to @host:@port', NULL, array('@host' => $this->hostname, '@port' => $this->port)); throw new FileTransferException('SSH Connection failed to @host:@port', NULL, array('@host' => $this->hostname, '@port' => $this->port));

View File

@ -32,7 +32,7 @@ class TestFileTransfer extends FileTransfer {
return new TestFileTransfer($jail, $settings['username'], $settings['password'], $settings['hostname'], $settings['port']); return new TestFileTransfer($jail, $settings['username'], $settings['password'], $settings['hostname'], $settings['port']);
} }
function connect() { public function connect() {
$this->connection = new MockTestConnection(); $this->connection = new MockTestConnection();
$this->connection->connectionString = 'test://' . urlencode($this->username) . ':' . urlencode($this->password) . "@$this->host:$this->port/"; $this->connection->connectionString = 'test://' . urlencode($this->username) . ':' . urlencode($this->password) . "@$this->host:$this->port/";
} }