Skip to content

Commit 492cfc9

Browse files
committed
Checks if the FTP extension is enabled before trying to connect to FTP servers.
1 parent 134f317 commit 492cfc9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-deploy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ class SFTP extends Server {
417417
class FTP extends Server {
418418

419419
public function connect($server) {
420+
421+
if (!extension_loaded('ftp')) {
422+
error("You need the FTP extension to be enabled if you want to deploy via FTP.");
423+
}
424+
420425
$this->connection = @ftp_connect($server['host'], $server['port'], 30);
421426

422427
if (!$this->connection) {

0 commit comments

Comments
 (0)