PHP code example of sputinyk / oossh
1. Go to this page and download the library: Download sputinyk/oossh library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sputinyk / oossh example snippets
$oossh = OOSSH\OOSSH::createAndLoad(
array(
'foo' => array(
'host' => 'foo.bar.baz',
'username' => 'foo',
'password' => 'baz',
)
)
);
$oossh->get('foo')->exec('uname -a', function($stdio, $stderr) {
echo $stdio;
if ($stderr) {
throw new RuntimeException($stderr);
}
});