Download the PHP package danielme85/simple-server-info without Composer
On this page you can find all versions of the php package danielme85/simple-server-info. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download danielme85/simple-server-info
More information about danielme85/simple-server-info
Files in danielme85/simple-server-info
Package simple-server-info
Short Description A simple PHP 7.1+ class to provide system information about your server/system build.
License MIT
Informations about the package simple-server-info
PHP Simple Server Info
A simple PHP 7.1+ class to provide system information about your unix/linux server/system.
Get CPU information and load. Memory and storage/volume usage and information. Made with efficiency and simplicity in mind. Information is read from the virtual filesystem "/proc" on Unix systems, as such Procfs is required. There is no usage of excec or other shell commands/hacks to get to the underlying system information. All information is read from the virtual /proc filesystem.
Requirements
- Unix/Linux OS supporting the /proc virtual file system.
- PHP 7.1 or later.
Installation
Include vendor/autoload.php or however else you prefer to include stuff to your project/framework.
Usage examples
Static shortcut
Currently supported info
The following information is supported.
CPU
The method "cpuInfo" returns an array with information about the CPU. This is per core, though most of the information is duplicated as the cores usually shares the same parent information. The array is organized and indexed with the core_id. To limit the information return you can specify the core and/or an array with the information you want. The method "cpuLoad" returns an array with the percentage load per core based on samples with a set sec (default 1 sec) pause in between.
Memory
The method "memoryUsage" returns information about the current memory usage in a byte format. The method "memoryLoad" returns the percentage load/usage.
Filesystem/Volumes
The method "volumesInfo" returns information about the mounted file systems/volumes.
Processes
The methods "processes" and "process" returns information about processes currently present in the /proc system on the system. There are results available from both the 'stat' and 'status' virtual system files. You can filter the results by passing an array of wanted columns, specify status/stat only and lastly set $runningonly = true/false.