PHP code example of shift31 / hostbase-cli

1. Go to this page and download the library: Download shift31/hostbase-cli 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/ */

    

shift31 / hostbase-cli example snippets




 return array(
     'baseUrl' => 'http://your.hostbase.server'
 );



 return array(
     'baseUrl' => 'http://hostbase.192.168.33.10.xip.io'
 );


$servers = [];
exec('hostbase hosts -s "env:prod AND role:www"', $servers);

$credentials = [];

foreach ($servers as $server) {
  $credentials[$server] = 'root@' . $server;
}