public function isDir($directory)
    {
        $pwd = $this->ftp->pwd();

        if ($pwd === false) {
            throw new FtpException('Unable to resolve the current directory');
        }

        if (@$this->ftp->chdir($directory)) {
            $this->ftp->chdir($pwd);
            return true;
        }

        $this->ftp->chdir($pwd);

        return false;
    }
public function isDir($directory)
    {
        $pwd = $this->ftp->pwd();

        if ($pwd === false) {
            throw new FtpException('Unable to resolve the current directory');
        }

        if (@$this->ftp->chdir($directory)) {
            $this->ftp->chdir($pwd);
            return true;
        }

        $this->ftp->chdir($pwd);

        return false;
    }
public function isDir ( $ directory ) { $ pwd = $ this -> ftp -> pwd ( ) ; if ( $ pwd === false ) { throw new FtpException ( 'Unable to resolve the current directory' ) ; } if ( @ $ this -> ftp -> chdir ( $ directory ) ) { $ this -> ftp -> chdir ( $ pwd ) ; return true ; } $ this -> ftp -> chdir ( $ pwd ) ; return false ; }
Check if a directory exist.

@param string $directory
@return bool
@throws FtpException
Check if a directory exist .