From 558ad0ce8acca590e424550c32dc7bb4d2f9c89d Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Thu, 10 Jul 2014 11:22:27 +0100 Subject: [PATCH] Issue #2242405 by mikebarkas, jlbellido | alexpott: Fixed FileTransfer::connect is protected yet the implementations are public and this is relied upon. --- core/lib/Drupal/Core/FileTransfer/FileTransfer.php | 2 +- core/lib/Drupal/Core/FileTransfer/Local.php | 2 +- core/lib/Drupal/Core/FileTransfer/SSH.php | 2 +- core/modules/system/src/Tests/FileTransfer/TestFileTransfer.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php index e1213925c69d..d64624b421ca 100644 --- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php +++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php @@ -110,7 +110,7 @@ function __get($name) { /** * Connects to the server. */ - abstract protected function connect(); + abstract public function connect(); /** * Copies a directory. diff --git a/core/lib/Drupal/Core/FileTransfer/Local.php b/core/lib/Drupal/Core/FileTransfer/Local.php index a0973be5c663..4f65e2273f0a 100644 --- a/core/lib/Drupal/Core/FileTransfer/Local.php +++ b/core/lib/Drupal/Core/FileTransfer/Local.php @@ -15,7 +15,7 @@ class Local extends FileTransfer implements ChmodInterface { /** * Implements Drupal\Core\FileTransfer\FileTransfer::connect(). */ - function connect() { + public function connect() { // No-op } diff --git a/core/lib/Drupal/Core/FileTransfer/SSH.php b/core/lib/Drupal/Core/FileTransfer/SSH.php index 82edcda5a120..91e6e5f70ddb 100644 --- a/core/lib/Drupal/Core/FileTransfer/SSH.php +++ b/core/lib/Drupal/Core/FileTransfer/SSH.php @@ -26,7 +26,7 @@ function __construct($jail, $username, $password, $hostname = "localhost", $port /** * 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)); diff --git a/core/modules/system/src/Tests/FileTransfer/TestFileTransfer.php b/core/modules/system/src/Tests/FileTransfer/TestFileTransfer.php index 92e736f2b4c4..1d1396094736 100644 --- a/core/modules/system/src/Tests/FileTransfer/TestFileTransfer.php +++ b/core/modules/system/src/Tests/FileTransfer/TestFileTransfer.php @@ -32,7 +32,7 @@ static function factory($jail, $settings) { 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/"; } -- GitLab