7

I have a program written in PHP that distributes files to various FTP sites. Recently, I added SFTP support to it using phpseclib. It's very easy to use to log in and upload the files.

However, there doesn't seem to be an explicit function to close a connection. This is important to me because I'm dealing with connecting /disconnecting to a number of sites during the processing.

How can I close a Net_SFTP connection?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
David Spencer
  • 77
  • 1
  • 9

1 Answers1

11

Does undefining your connection work (as mentioned in this Perl 5 example)?

unset($sftp);  

where $sftp is the variable holding your connection.

Christopher Bottoms
  • 11,218
  • 8
  • 50
  • 99