public function connect()
    {
        $this->errorHandler->start();

        //create the connection
        if ($this->configuration->getSSL()) {
            $this->resource = $this->driver->sslConnect($this->configuration->getHost(), $this->configuration->getPort(), $this->configuration->getTimeout());
        } else {
            $this->resource = $this->driver->connect($this->configuration->getHost(), $this->configuration->getPort(), $this->configuration->getTimeout());
        }

        if ($this->resource !== false) {
            //log in
            if ($this->driver->login($this->resource, $this->configuration->getUser(), $this->configuration->getPass())) {
                //change directory
                if ($this->driver->pasv($this->resource, $this->configuration->getPasv())) {
                    if ($this->driver->chdir($this->resource, $this->configuration->getDir())) {
                        $this->dir = ftp_pwd($this->resource);
                        $this->errorHandler->stop();

                        return true;
                    }
                }
            }
        }
        $this->errorHandler->stop();

        return false;
    }
public function connect()
    {
        $this->errorHandler->start();

        //create the connection
        if ($this->configuration->getSSL()) {
            $this->resource = $this->driver->sslConnect($this->configuration->getHost(), $this->configuration->getPort(), $this->configuration->getTimeout());
        } else {
            $this->resource = $this->driver->connect($this->configuration->getHost(), $this->configuration->getPort(), $this->configuration->getTimeout());
        }

        if ($this->resource !== false) {
            //log in
            if ($this->driver->login($this->resource, $this->configuration->getUser(), $this->configuration->getPass())) {
                //change directory
                if ($this->driver->pasv($this->resource, $this->configuration->getPasv())) {
                    if ($this->driver->chdir($this->resource, $this->configuration->getDir())) {
                        $this->dir = ftp_pwd($this->resource);
                        $this->errorHandler->stop();

                        return true;
                    }
                }
            }
        }
        $this->errorHandler->stop();

        return false;
    }
public function connect ( ) { $ this -> errorHandler -> start ( ) ; //create the connection if ( $ this -> configuration -> getSSL ( ) ) { $ this -> resource = $ this -> driver -> sslConnect ( $ this -> configuration -> getHost ( ) , $ this -> configuration -> getPort ( ) , $ this -> configuration -> getTimeout ( ) ) ; } else { $ this -> resource = $ this -> driver -> connect ( $ this -> configuration -> getHost ( ) , $ this -> configuration -> getPort ( ) , $ this -> configuration -> getTimeout ( ) ) ; } if ( $ this -> resource !== false ) { //log in if ( $ this -> driver -> login ( $ this -> resource , $ this -> configuration -> getUser ( ) , $ this -> configuration -> getPass ( ) ) ) { //change directory if ( $ this -> driver -> pasv ( $ this -> resource , $ this -> configuration -> getPasv ( ) ) ) { if ( $ this -> driver -> chdir ( $ this -> resource , $ this -> configuration -> getDir ( ) ) ) { $ this -> dir = ftp_pwd ( $ this -> resource ) ; $ this -> errorHandler -> stop ( ) ; return true ; } } } } $ this -> errorHandler -> stop ( ) ; return false ; }
Standard function for creating a FTP connection and logging in.

This must be called before any of the other functions in the
Interface. However the construct itself calles this
function upon completion, which alleviates the need to ever call
this function manualy.

@return boolean
Standard function for creating a FTP connection and logging in .