Sftp.php.dist 366 B

12345678910111213
  1. <?php
  2. $configuration = new Ssh\Configuration();
  3. $authentication = new Ssh\Authentication\None();
  4. $session = new Ssh\Session($configuration, $authentication);
  5. $directory = '/some/directory';
  6. $adapter = new Gaufrette\Adapter\Sftp($session->getSftp(), '/some/directory');
  7. ssh2_exec($session->getresource(), sprintf('rm -r %s/*', $directory));
  8. return $adapter;