private function isDir($dir) { $current = $this->getDir(); try { $this->ftp('chdir', $dir); } catch (FtpException $e) { } $this->ftp('chdir', $current ?: '/'); return empty($e); }