Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

SysInfo is a PHP library that can be used to fetch information about the system (CPU usage, Load avg., Memory usage +++)

branch: develop

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 ChangeLog.markdown
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 composer.json
Octocat-spinner-32 phpunit.xml.dist
README.markdown

SysInfo

PHP library that can be used to fetch system information like CPU usage, load averages and memory usage (amongst other features). The library was made to accomodate a PHPUnit test listener, so the featureset is pretty slim, and only works on Linux. Feel free to play around with it and send a PR if you want to add some features (unit tests required).

Installation

To use this library you can specify christeredvartsen/sysinfo in your composer.json file.

Usage

<?php
$sysInfo = SysInfo\SysInfo::factory(); // automatically choose instance based on PHP_OS

// or

$sysInfo = new SysInfo\Linux();

$cpu = $sysInfo->getCPU(); // Fetch snapshot of CPU info
$load = $sysInfo->getLoad(); // Fetch snapshot of Load info
$uptime = $sysInfo->getUptime(); // Fetch snapshot of Uptime info
$memory = $sysInfo->getMemory(); // Fetch snapshot of Memory info
$disk = $sysInfo->getDisk(); // Fetch snapshot of Disk info

See the CPUInterface.php, DiskInterface.php, LoadInterface.php, UptimeInterface.php and MemoryInterface.php interfaces for more docs.

Something went wrong with that request. Please try again.