diff --git a/composer.json b/composer.json index 811ce3c22922..5214f6e73cdf 100644 --- a/composer.json +++ b/composer.json @@ -116,6 +116,7 @@ "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", "league/flysystem-cached-adapter": "Required to use Flysystem caching (~1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (~1.0).", "nexmo/client": "Required to use the Nexmo transport (~1.0).", "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", diff --git a/src/Illuminate/Filesystem/FilesystemManager.php b/src/Illuminate/Filesystem/FilesystemManager.php index 04c1bac53a30..9505a3a3884e 100644 --- a/src/Illuminate/Filesystem/FilesystemManager.php +++ b/src/Illuminate/Filesystem/FilesystemManager.php @@ -8,6 +8,7 @@ use Illuminate\Support\Arr; use InvalidArgumentException; use League\Flysystem\AdapterInterface; +use League\Flysystem\Sftp\SftpAdapter; use League\Flysystem\FilesystemInterface; use League\Flysystem\Cached\CachedAdapter; use League\Flysystem\Filesystem as Flysystem; @@ -176,6 +177,19 @@ public function createFtpDriver(array $config) )); } + /** + * Create an instance of the sftp driver. + * + * @param array $config + * @return \Illuminate\Contracts\Filesystem\Filesystem + */ + public function createSftpDriver(array $config) + { + return $this->adapt($this->createFlysystem( + new SftpAdapter($config), $config + )); + } + /** * Create an instance of the Amazon S3 driver. * diff --git a/src/Illuminate/Filesystem/composer.json b/src/Illuminate/Filesystem/composer.json index f9e205f4ab73..fa1ad3ea52f0 100644 --- a/src/Illuminate/Filesystem/composer.json +++ b/src/Illuminate/Filesystem/composer.json @@ -32,7 +32,8 @@ "suggest": { "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", - "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0)." + "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (~1.0)." }, "config": { "sort-packages": true