Pop\Ftp\Ftp::__construct PHP Метод

__construct() публичный Метод

Instantiate the FTP object.
public __construct ( string $ftp, string $user, string $pass, boolean $ssl = false ) : Ftp
$ftp string
$user string
$pass string
$ssl boolean
Результат Ftp
    public function __construct($ftp, $user, $pass, $ssl = false)
    {
        if (!function_exists('ftp_connect')) {
            throw new Exception('Error: The FTP extension is not available.');
        } else {
            if ($ssl) {
                if (!($this->conn = ftp_ssl_connect($ftp))) {
                    throw new Exception('Error: There was an error connecting to the FTP server ' . $ftp);
                }
            } else {
                if (!($this->conn = ftp_connect($ftp))) {
                    throw new Exception('Error: There was an error connecting to the FTP server ' . $ftp);
                }
            }
        }
        if (!ftp_login($this->conn, $user, $pass)) {
            throw new Exception('Error: There was an error connecting to the FTP server ' . $ftp . ' with those credentials.');
        }
    }