PHP code example of typomedia / sysinfo

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

    

typomedia / sysinfo example snippets


use Typomedia\Sysinfo\SysinfoFactory;
use Typomedia\Sysinfo\Exception\UnsupportedSystemException;

/**
 * @var Composer\Autoload\ClassLoader $loader
 */
sinfo->getOsRelease();
    $values['OsKernelVersion'] = $sysinfo->getOsKernelVersion();
    $values['Architecture'] = $sysinfo->getArchitecture();
    $values['Hostname'] = $sysinfo->getHostname();
    $values['CpuModel'] = $sysinfo->getCpuModel();
    $values['CpuCores'] = $sysinfo->getCpuCores();
    $values['PhpVersion'] = $sysinfo->getPhpVersion();
    $values['TotalMem'] = $sysinfo->getTotalMem();
    $values['DiskTotal'] = $sysinfo->getDiskTotal();
    $values['DiskUsage'] = $sysinfo->getDiskUsage();
    $values['DiskFree'] = $sysinfo->getDiskFree();
} catch (UnsupportedSystemException $e) {
    $values['Exception'] = $e->getMessage();
}

foreach ($values as $key => $value) {
    print $key . ': ' . $value . PHP_EOL;
}

$end  = microtime(true);
$time = round(($end - $start) * 1000);
print $time . ' ms' . PHP_EOL;