tjm/shell-runner

Run shell commands over ssh or locally from PHP.

Installs: 101

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/tjm/shell-runner

v0.0.14 2023-10-03 20:44 UTC

This package is auto-updated.

Last update: 2025-09-28 21:37:20 UTC


README

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