File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function __call($func, $args) {
28
28
public function list ($ addr , $ limit = 0 ) {
29
29
if (!$ this ->is_connected ()) return false ;
30
30
$ result = array ();
31
- $ files = scandir ( ' ssh2.sftp:// ' . $ this ->sftp . ' / ' . $ addr );
31
+ $ files = $ this ->ls ( $ addr );
32
32
if (!empty ($ files )) {
33
33
$ i = 0 ;
34
34
foreach ($ files as $ file ) {
@@ -42,6 +42,11 @@ public function list($addr, $limit = 0) {
42
42
return $ result ;
43
43
}
44
44
45
+ public function ls ($ addr ) {
46
+ $ files = scandir ('ssh2.sftp:// ' .$ this ->sftp .'/ ' .$ addr );
47
+ return $ files ;
48
+ }
49
+
45
50
public function mv ($ file , $ dest_file , $ rename_exists = true ) {
46
51
if (!$ this ->is_connected ()) return false ;
47
52
@@ -112,4 +117,4 @@ public function is_dir($remote_file) {
112
117
public function exists ($ remote_file ) {
113
118
return file_exists ('ssh2.sftp:// ' .$ this ->sftp .'/ ' .$ remote_file );
114
119
}
115
- }
120
+ }
You can’t perform that action at this time.
0 commit comments