File tree 3 files changed +9
-1
lines changed
3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Config::set('ftp.connections.key', array(
38
38
'username' => '',
39
39
'password' => '',
40
40
'passive' => false,
41
+ 'secure' => false,
41
42
));
42
43
```
43
44
Original file line number Diff line number Diff line change @@ -42,8 +42,14 @@ public function connect($config)
42
42
$ config ['port ' ] = 21 ;
43
43
if (!isset ($ config ['timeout ' ]))
44
44
$ config ['timeout ' ] = 90 ;
45
+ if (!isset ($ config ['secure ' ]))
46
+ $ config ['secure ' ] = false ;
45
47
46
- $ connectionId = ftp_connect ($ config ['host ' ],$ config ['port ' ],$ config ['timeout ' ]);
48
+ if ($ config ['secure ' ]) {
49
+ $ connectionId = ftp_ssl_connect ($ config ['host ' ], $ config ['port ' ], $ config ['timeout ' ]);
50
+ } else {
51
+ $ connectionId = ftp_connect ($ config ['host ' ], $ config ['port ' ], $ config ['timeout ' ]);
52
+ }
47
53
if ($ connectionId ) {
48
54
$ loginResponse = ftp_login ($ connectionId , $ config ['username ' ], $ config ['password ' ]);
49
55
ftp_pasv ($ connectionId , $ config ['passive ' ]);
Original file line number Diff line number Diff line change 30
30
'username ' => '' ,
31
31
'password ' => '' ,
32
32
'passive ' => false ,
33
+ 'secure ' => false
33
34
),
34
35
),
35
36
);
You can’t perform that action at this time.
0 commit comments