Skip to content

tobymackenzie/shell-runner.php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shell Runner

Run shell commands locally or via SSH. Primarily for simplifying running commands on remote machines, either interactively or capturing the output.

Usage

Install via composer. Example usage:

<?php
use TJM\ShellRunner\ShellRunner;

$shell = new ShellRunner();

//--run `ls` locally, capturing output
$output = $shell->run(Array(
	'command'=> 'ls'
));

//--run `ls` remotely, capturing output
$output = $shell->run(Array(
	'command'=> 'ls'
	,'host'=> 'tobymackenzie.com'
));

//--SSH into remote machine interactively.  Will not capture output.  Interaction will require running PHP on command line, not in browser.
$shell->run(Array(
	'host'=> 'tobymackenzie.com'
	,'interactive'=> true
));

Other Options

About

Run shell commands locally or via SSH

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages