Skip to content

Commit

Permalink
[5.6] SFTP driver (#23308)
Browse files Browse the repository at this point in the history
* add sftp driver

* style
  • Loading branch information
mputkowski authored and taylorotwell committed Feb 27, 2018
1 parent 9288069 commit c466c77
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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).",
Expand Down
14 changes: 14 additions & 0 deletions src/Illuminate/Filesystem/FilesystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Filesystem/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c466c77

Please sign in to comment.