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) {
2828 public function list ($ addr , $ limit = 0 ) {
2929 if (!$ this ->is_connected ()) return false ;
3030 $ result = array ();
31- $ files = scandir ( ' ssh2.sftp:// ' . $ this ->sftp . ' / ' . $ addr );
31+ $ files = $ this ->ls ( $ addr );
3232 if (!empty ($ files )) {
3333 $ i = 0 ;
3434 foreach ($ files as $ file ) {
@@ -42,6 +42,11 @@ public function list($addr, $limit = 0) {
4242 return $ result ;
4343 }
4444
45+ public function ls ($ addr ) {
46+ $ files = scandir ('ssh2.sftp:// ' .$ this ->sftp .'/ ' .$ addr );
47+ return $ files ;
48+ }
49+
4550 public function mv ($ file , $ dest_file , $ rename_exists = true ) {
4651 if (!$ this ->is_connected ()) return false ;
4752
@@ -112,4 +117,4 @@ public function is_dir($remote_file) {
112117 public function exists ($ remote_file ) {
113118 return file_exists ('ssh2.sftp:// ' .$ this ->sftp .'/ ' .$ remote_file );
114119 }
115- }
120+ }
You can’t perform that action at this time.
0 commit comments