protected function getFtpConnection()
    {
        if (is_null($this->ftpConnection)) {
            $host = $this->connection['host'];
            $user = $this->connection['user'];
            $pass = $this->connection['pass'];

            $this->ftpConnection = $this->connect($host, $user, $pass);

            // set timeout
            ftp_set_option($this->ftpConnection, FTP_TIMEOUT_SEC, $this->connection['timeout']);

            // set passive mode if it's defined
            if (null !== $pasv = $this->getPasv()) {
                ftp_pasv($this->ftpConnection, $pasv);
            }
        }

        return $this->ftpConnection;
    }