FtpClient\FtpWrapper::ssl_connect PHP Method

ssl_connect() public method

Opens a Secure SSL-FTP connection
public ssl_connect ( string $host, integer $port = 21, integer $timeout = 90 ) : resource
$host string
$port integer
$timeout integer
return resource
    public function ssl_connect($host, $port = 21, $timeout = 90)
    {
        return ftp_ssl_connect($host, $port, $timeout);
    }

Usage Example

Example #1
0
 /**
  * Open a FTP connection.
  *
  * @param string $host
  * @param bool   $ssl
  * @param int    $port
  * @param int    $timeout
  *
  * @return FTPClient
  * @throws FtpException If unable to connect
  */
 public function connect($host, $ssl = false, $port = 21, $timeout = 90)
 {
     if ($ssl) {
         $this->conn = @$this->ftp->ssl_connect($host, $port, $timeout);
     } else {
         $this->conn = @$this->ftp->connect($host, $port, $timeout);
     }
     if (!$this->conn) {
         throw new FtpException('Unable to connect');
     }
     return $this;
 }