Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Last active May 5, 2017 13:56
Show Gist options
  • Save niraj-shah/2d9d8ce2f3193f795a5c133cebb6476a to your computer and use it in GitHub Desktop.
Save niraj-shah/2d9d8ce2f3193f795a5c133cebb6476a to your computer and use it in GitHub Desktop.
More SSH / SFTP Commands in Laravel 5.x
<?php
// get list of files / directories, returns array
SSH::getGateway()->getConnection()->nlist('.');
// get current working directory, returns string
SSH::getGateway()->getConnection()->pwd();
// check for directory, returns boolean
SSH::getGateway()->getConnection()->is_dir("Directory");
// check for file, returns boolean
SSH::getGateway()->getConnection()->is_file("Directory");
// change to directory, returns boolean
SSH::getGateway()->getConnection()->chdir("Directory");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment