From ba8b0bc8acb15a605efc8cda87cd9907f6df3dfc Mon Sep 17 00:00:00 2001 From: Sina Date: Tue, 2 Feb 2021 13:27:08 +0330 Subject: [PATCH 1/3] Support retrieving URL for Sftp adapter --- src/Illuminate/Filesystem/FilesystemAdapter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index 1c33b9892676..822a92824854 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -13,6 +13,7 @@ use Illuminate\Support\Str; use InvalidArgumentException; use League\Flysystem\Adapter\Ftp; +use League\Flysystem\Sftp\SftpAdapter as Sftp; use League\Flysystem\Adapter\Local as LocalAdapter; use League\Flysystem\AdapterInterface; use League\Flysystem\AwsS3v3\AwsS3Adapter; @@ -449,7 +450,7 @@ public function url($path) return $this->driver->getUrl($path); } elseif ($adapter instanceof AwsS3Adapter) { return $this->getAwsUrl($adapter, $path); - } elseif ($adapter instanceof Ftp) { + } elseif ($adapter instanceof Ftp or $adapter instanceof Sftp) { return $this->getFtpUrl($path); } elseif ($adapter instanceof LocalAdapter) { return $this->getLocalUrl($path); From 2fe91f91576fc240ac1cddcad57905a6afc420b6 Mon Sep 17 00:00:00 2001 From: Sina Date: Tue, 2 Feb 2021 13:59:42 +0330 Subject: [PATCH 2/3] CS Fix --- src/Illuminate/Filesystem/FilesystemAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index 822a92824854..537238ba3bdd 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -13,7 +13,6 @@ use Illuminate\Support\Str; use InvalidArgumentException; use League\Flysystem\Adapter\Ftp; -use League\Flysystem\Sftp\SftpAdapter as Sftp; use League\Flysystem\Adapter\Local as LocalAdapter; use League\Flysystem\AdapterInterface; use League\Flysystem\AwsS3v3\AwsS3Adapter; @@ -21,6 +20,7 @@ use League\Flysystem\FileExistsException; use League\Flysystem\FileNotFoundException; use League\Flysystem\FilesystemInterface; +use League\Flysystem\Sftp\SftpAdapter as Sftp; use PHPUnit\Framework\Assert as PHPUnit; use Psr\Http\Message\StreamInterface; use RuntimeException; From 22456df8a8502670ce01f86bced3f48a677c1f6b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 2 Feb 2021 07:47:03 -0600 Subject: [PATCH 3/3] Update FilesystemAdapter.php --- src/Illuminate/Filesystem/FilesystemAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index 537238ba3bdd..896bfbd6f35a 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -450,7 +450,7 @@ public function url($path) return $this->driver->getUrl($path); } elseif ($adapter instanceof AwsS3Adapter) { return $this->getAwsUrl($adapter, $path); - } elseif ($adapter instanceof Ftp or $adapter instanceof Sftp) { + } elseif ($adapter instanceof Ftp || $adapter instanceof Sftp) { return $this->getFtpUrl($path); } elseif ($adapter instanceof LocalAdapter) { return $this->getLocalUrl($path);