diff --git a/src/Deployment/FtpServer.php b/src/Deployment/FtpServer.php index d60aa88..30a67b8 100644 --- a/src/Deployment/FtpServer.php +++ b/src/Deployment/FtpServer.php @@ -54,6 +54,13 @@ public function __construct( $this->passiveMode = $passiveMode; } + function __destruct() + { + if ($this->connection) { // reconnect? + @ftp_close($this->connection); // @ may fail + } + } + /** * Connects to FTP server.