FtpClient\FtpClient::isDir PHP Method

isDir() public method

Check if a directory exist.
public isDir ( string $directory ) : boolean
$directory string
return boolean
    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;
    }