PHP code example of ocolin / tachyon-lite

1. Go to this page and download the library: Download ocolin/tachyon-lite 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/ */

    

ocolin / tachyon-lite example snippets


use Ocolin\TachyonLite\Config;
use Ocolin\TachyonLite\TachyonLite;

$client = new TachyonLite( config: new Config(
    host:     '10.0.0.1',
    username: 'admin',
    password: 'secret',
));

$client = new TachyonLite();

$entries = $client->getMacTable();

foreach( $entries as $entry ) {
    echo $entry->mac       . PHP_EOL; // f4:1e:57:8f:58:6a
    echo $entry->interface . PHP_EOL; // eth5
    echo $entry->vlan      . PHP_EOL; // 1
    echo $entry->bridge    . PHP_EOL; // br-wan
    echo $entry->offload   . PHP_EOL; // true
}

$status = $client->getStatus();

echo $status->system->model;      // TNS-100
echo $status->system->fw_version; // 1.0.0
echo $status->network->hostname;  // my-device

$status = $client->getStatus( types: ['system', 'network'] );