trntv/probe

系统信息提供者

1.0.1 2018-05-04 09:06 UTC

This package is auto-updated.

Last update: 2024-09-20 03:23:13 UTC


README

Build Status

此包提供了一个简单界面,用于获取系统运行时的信息。

$provider = \Probe\ProviderFactory::create();
$provider->getCpuModel();
$provider->getCpuUsage();
$provider->getFreeMem();

可用方法

  • getOsRelease()
  • getOsType();
  • getOsKernelVersion();
  • getArchitecture();
  • getDbVersion(\PDO $connection);
  • getDbInfo(\PDO $connection);
  • getDbType(\PDO $connection);
  • getTotalMem();
  • getFreeMem();
  • getUsedMem();
  • getTotalSwap();
  • getFreeSwap();
  • getUsedSwap();
  • getHostname();
  • isLinuxOs();
  • isWindowsOs();
  • isBsdOs();
  • isMacOs();
  • getUptime();
  • getPhysicalCpus();
  • getCpuCores();
  • getCpuPhysicalCore();
  • getCpuModel();
  • getCpuUsage();
  • getServerIP();
  • getExternalIP();
  • getServerSoftware();
  • isISS();
  • isNginx();
  • isApache();
  • getPhpInfo($what = -1);
  • getPhpVersion();
  • getPhpDisabledFunctions();
  • getPhpModules();
  • isPhpModuleLoaded($module);
  • getPing(array $hosts = null, $count = 2);
  • getServerVariable($key);
  • getPhpSapiName();
  • isFpm();
  • isCli();

支持的操作系统

  • Linux
  • Windows
  • MacOS

注意:要获取Windows系统信息,应在您的php.ini中启用php_com_dotnet.dll

[COM_DOT_NET] 
extension=php_com_dotnet.dll

Linux特有方法

  • getCoresPerSocket()
  • getCpuinfoByLsCpu()

贡献

我没有特别的规则。任何形式的帮助都将是有用的。

待办事项

  • 磁盘使用情况
  • 接收/发送
  • 进程列表