added setting and possible fix for passive mode. fixes #135 probably

This commit is contained in:
Christian Haschek
2022-01-24 15:23:38 +01:00
parent b669e69511
commit 9200d3d93c
3 changed files with 11 additions and 1 deletions

View File

@@ -23,7 +23,15 @@ class FTPStorage implements StorageController
if($this->connection && !$this->login)
{
$this->login = ftp_login($this->connection, FTP_USER, FTP_PASS);
ftp_pasv($this->connection, TRUE);
if( (defined('FTP_PASSIVEMODE') && FTP_PASSIVEMODE === true) || !defined('FTP_PASSIVEMODE') )
{
ftp_set_option($this->connection, FTP_USEPASVADDRESS, false);
ftp_pasv($this->connection, TRUE);
}
else
ftp_pasv($this->connection, false);
}
// Was the connection successful?