简体   繁体   English

使用phpseclib关闭Net_SFTP连接

[英]Using phpseclib to close a Net_SFTP connection

I have a program written in PHP that distributes files to various FTP sites. 我有一个用PHP编写的程序,它将文件分发到各种FTP站点。 Recently, I added SFTP support to it using phpseclib . 最近,我使用phpseclib添加了SFTP支持。 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? 如何关闭Net_SFTP连接?

Does undefining your connection work ( as mentioned in this Perl 5 example )? 取消定义您的连接是否正常工作( 如本Perl 5示例中所述 )?

unset($sftp);  

where $sftp is the variable holding your connection. 其中$sftp是保存连接的变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM