SysInfo is a simple library to get some info, metrics and available resources of the system the PHP code is running on.
PHP >= 7.0.10 is recommended. It's not required in composer.json so PHP projects stuck on older PHP versions could use it on their own consideration. The library does not work on PHP < 5.6.
This library use some native PHP functions like
memory_get_peak_usage which may be disabled by some shared hostings.
sys_getloadavg is only available on linux based systems. Therefore Windows is not supported. The support can be added with new class.
SysInfo using Composer.
$ composer require cronfig/sysinfo
use Cronfig\Sysinfo\System; // Instantiate the system $system = new System; // System can get you the OS you are currently running $os = $system->getOs(); // Get some metrics like free disk space $freeSpace = $os->getDiskUsagePercentage();
$ composer test
The MIT License (MIT). Please see LICENSE for more information.