public function isDirectory($key) { $this->initialize(); $pwd = $this->sftp->pwd(); if ($this->sftp->chdir($this->computePath($key))) { $this->sftp->chdir($pwd); return true; } return false; }