aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/sftp.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/sftp.php')
-rw-r--r--apps/files_external/lib/sftp.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index 03ece9cb9dd..7f921b5342f 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -29,9 +29,8 @@
*
*/
namespace OC\Files\Storage;
+use Icewind\Streams\IteratorDirectory;
-use phpseclib\Net\RSA;
-use phpseclib\Net\SFTP;
use phpseclib\Net\SFTP\Stream;
/**
@@ -91,7 +90,7 @@ class SFTP extends \OC\Files\Storage\Common {
/**
* Returns the connection.
*
- * @return SFTP connected client instance
+ * @return \phpseclib\Net\SFTP connected client instance
* @throws \Exception when the connection failed
*/
public function getConnection() {
@@ -100,7 +99,7 @@ class SFTP extends \OC\Files\Storage\Common {
}
$hostKeys = $this->readHostKeys();
- $this->client = new SFTP($this->host, $this->port);
+ $this->client = new \phpseclib\Net\SFTP($this->host, $this->port);
// The SSH Host Key MUST be verified before login().
$currentHostKey = $this->client->getServerPublicHostKey();
@@ -282,8 +281,7 @@ class SFTP extends \OC\Files\Storage\Common {
$dirStream[] = $file;
}
}
- \OC\Files\Stream\Dir::register($id, $dirStream);
- return opendir('fakedir://' . $id);
+ return IteratorDirectory::wrap($dirStream);
} catch(\Exception $e) {
return false;
}