Issue #2242405 by mikebarkas, jlbellido | alexpott: Fixed FileTransfer::connect is protected yet the implementations are public and this is relied upon.
parent
2aa98311cf
commit
558ad0ce8a
|
@ -110,7 +110,7 @@ abstract class FileTransfer {
|
|||
/**
|
||||
* Connects to the server.
|
||||
*/
|
||||
abstract protected function connect();
|
||||
abstract public function connect();
|
||||
|
||||
/**
|
||||
* Copies a directory.
|
||||
|
|
|
@ -15,7 +15,7 @@ class Local extends FileTransfer implements ChmodInterface {
|
|||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::connect().
|
||||
*/
|
||||
function connect() {
|
||||
public function connect() {
|
||||
// No-op
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::connect().
|
||||
*/
|
||||
function connect() {
|
||||
public function connect() {
|
||||
$this->connection = @ssh2_connect($this->hostname, $this->port);
|
||||
if (!$this->connection) {
|
||||
throw new FileTransferException('SSH Connection failed to @host:@port', NULL, array('@host' => $this->hostname, '@port' => $this->port));
|
||||
|
|
|
@ -32,7 +32,7 @@ class TestFileTransfer extends FileTransfer {
|
|||
return new TestFileTransfer($jail, $settings['username'], $settings['password'], $settings['hostname'], $settings['port']);
|
||||
}
|
||||
|
||||
function connect() {
|
||||
public function connect() {
|
||||
$this->connection = new MockTestConnection();
|
||||
$this->connection->connectionString = 'test://' . urlencode($this->username) . ':' . urlencode($this->password) . "@$this->host:$this->port/";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue