summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorhkjolhede <hkjolhede@gmail.com>2012-12-28 22:22:04 +0100
committerhkjolhede <hkjolhede@gmail.com>2012-12-28 22:22:04 +0100
commitab4d52e9802a9710a04c32574f1521880c0d74e4 (patch)
tree63e52d8693322471c3c1c824c3df6345e3f40c9f /apps
parentab31c3ef4ef921bb14aa148f2d3087b93d4be0e4 (diff)
downloadnextcloud-server-ab4d52e9802a9710a04c32574f1521880c0d74e4.tar.gz
nextcloud-server-ab4d52e9802a9710a04c32574f1521880c0d74e4.zip
Update apps/files_external/lib/sftp.php
Created test() function as per @pull/1031
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/sftp.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index 7113eadfa2b..22cb8d1651c 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -20,10 +20,6 @@ class OC_Filestorage_SFTP extends OC_Filestorage_Common {
private static $tempFiles = array();
public function __construct($params) {
- if (!isset($params['host']) || !isset($params['user']) || !isset($params['password'])) {
- throw new Exception("Required parameters not set");
- }
-
$this->host = $params['host'];
$proto = strpos($this->host, '://');
if ($proto != false) {
@@ -53,6 +49,12 @@ class OC_Filestorage_SFTP extends OC_Filestorage_Common {
$this->write_host_keys($host_keys);
}
}
+
+ public function test() {
+ if (!isset($params['host']) || !isset($params['user']) || !isset($params['password'])) {
+ throw new Exception("Required parameters not set");
+ }
+ }
private function abs_path($path) {
return $this->root . $path;