Download the PHP package plinker/system without Composer
On this page you can find all versions of the php package plinker/system. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download plinker/system
More information about plinker/system
Files in plinker/system
Package system
Short Description System component which gives you access to server information.
License MIT
Homepage https://github.com/plinker-rpc
Informations about the package system
PlinkerRPC - System
A system component which gives you access to server information.
Install
Require this package with composer using the following command:
Client
Creating a client instance is done as follows:
<?php
require 'vendor/autoload.php';
/**
* Initialize plinker client.
*
* @param string $server - URL to server listener.
* @param string $config - server secret, and/or a additional component data
*/
$client = new \Plinker\Core\Client(
'http://example.com/server.php',
[
'secret' => 'a secret password'
]
);
// or using global function
$client = plinker_client('http://example.com/server.php', 'a secret password');
Methods
Once setup, you call the class though its namespace to its method.
Enumerate
The enumerate method is used to call multiple methods in a single call to reduce RPC requests.
Parameter | Type | Description | Default | |
---|---|---|---|---|
methods | string | array | A string or an array of methods | [] |
params | array | An array of params | [] |
The method could be used to call a single method, or multiple with parameters.
Call
Response
Arch
Returns the system architecture.
Call
Response
Clear Swap
Clear swap space, requires root, so should be used with task.
Call
Response
CPU Info
Returns information about the CPU.
Parameter | Type | Description | Default |
---|---|---|---|
parse | bool | Parse output into an array | true |
Call
Response
Disk Space
Returns disk space left in percentage.
Parameter | Type | Description | Default |
---|---|---|---|
path | string | A directory of the filesystem or disk partition. | / |
Call
Response
Disks
Return mounted disks.
Parameter | Type | Description | Default |
---|---|---|---|
parse | bool | Parse output into an array | true |
Call
Response
Distro
Get system distro name.
Call
Response
Drop Cache
Drop memory caches, requires root, so should be used with task.
Call
Response
Hostname
Get the systems hostname.
Call
Response
Load
Get the systems load averages.
Parameter | Type | Description | Default |
---|---|---|---|
parse | bool | Parse output into an array | true |
Call
Response
Logins
Returns an array of system logins.
Call
Response
Machine ID
Returns the machine-id for the system, generates one if does not have one.
Call
Response
Memory Stats
Returns an array of memory stats for, used, cached and free in percentage values.
Call
Response
Memory Total
Get the total amount of memory in kB
Call
Response
Netstat
Get network connections.
Parameter | Type | Description | Default |
---|---|---|---|
parse | bool | Parse output into an array | true |
Call
Response
Ping
Ping a hostname and return connection timing in milliseconds.
Parameter | Type | Description | Default |
---|---|---|---|
host | string | Server hostname | |
port | int | Service port, defaults to web | 80 |
Call
Response
PStree
Return system process tree
Call
Response
Reboot
Reboot the server, requires root, so should be used with task.
Call
Response
CPU Usage
Returns the current CPU usage in percentage value.
Call
Response
System Updates
Check whether the system has updates.
Call
Response
Top
Get top output as an array.
Parameter | Type | Description | Default |
---|---|---|---|
parse | bool | Parse output into an array | true |
Call
Response
Total Disk Space
Get total disk space in bytes.
Parameter | Type | Description | Default |
---|---|---|---|
path | string | A directory of the filesystem or disk partition. | / |
Call
Response
Uname
Get system name/kernel version.
Call
Response
Uptime
Get system uptime string.
Call
Response
Testing
There are no tests setup for this component.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please contact me via https://cherone.co.uk instead of using the issue tracker.
Credits
Development Encouragement
If you use this project and make money from it or want to show your appreciation, please feel free to make a donation https://www.paypal.me/lcherone, thanks.
Sponsors
Get your company or name listed throughout the documentation and on each github repository, contact me at https://cherone.co.uk for further details.
License
The MIT License (MIT). Please see License File for more information.
See the organisations page for additional components.