kingzeus/yii2-system-info

服务器信息

v1.0.2 2015-05-10 09:08 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:38:30 UTC


README

基于abhi1693/yii2-system-info

提供关于您系统/服务器的信息。它自动检测您正在使用的系统类型,并提供相应的信息。

支持的操作系统

  • Windows
  • Linux
  • OSX(Darwin)

方法

  • getOS
  • getKernelVersion
  • getHostname
  • getCpuModel
  • getCpuVendor
  • getCpuFreq
  • getCpuArchitecture
  • getCpuCores
  • getLoad
  • getUpTime
  • getPhpVersion
  • getServerName
  • getServerProtocol
  • getServerSoftware
  • getTotalMemory

安装

将System-Info添加到您的composer.json文件的require部分

{
    "require": {
        "kingzeus/yii2-system-info": "1.0.x"
    }
}

然后运行以下命令使用composer下载扩展

$ php composer.phar update

用法

// Get the class to work with the current operating system
$system = SystemInfo::getInfo();

// Captain Obvious was here
$system::getHostname();

常见问题解答

COM未找到

PHP 5.4.5开始,COM不再内置到PHP核心中。您需要在php.ini中添加COM支持。

[COM_DOT_NET] 
extension=php_com_dotnet.dll 

否则您将在错误日志中看到以下内容:Fatal error: Class \'COM\' not found

贡献

贡献说明位于CONTRIBUTING.md文件中。