getSftp(), '/some/directory'); ssh2_exec($session->getresource(), sprintf('rm -r %s/*', $directory)); return $adapter;