I want to run different php scripts based on result of execution of previous script (via AJAX), but I can't implement needed logic inside one script (and one SFTP connection) because decisions on which script to run next must be made by a user.
So my question is: is it ok to establish a new SFTP connection ( $sftp->login()
) every time I run a script using phpseclib?
If it is, then is there a limit on how many connections are allowed per some time frame?
If not, is there a way to "store" current connection and check if it has timed out (if it is applicable in this case) on every new script execution? Or some other "best practice" for this case?