login('username', 'password'); $directory = '/some/directory'; $sftp->delete($directory, true); $adapter = new Gaufrette\Adapter\PhpseclibSftp($sftp, $directory, true); return $adapter;