abhi1693/yii2-system-info

v1.0.0 2015-02-16 11:41 UTC

This package is not auto-updated.

Last update: 2024-09-25 14:00:42 UTC


README

Gratipay User Dependency Status Code Climate Latest Stable Version Total Downloads Latest Unstable Version License

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

捐赠

任何捐赠都有助于我们改进 Yii2 System Info,如果您也想帮助我们,但不想参与编码,我们不会拒绝PayPal

paypal

支持的操作系统

  • Windows
  • Linux

方法

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

安装

运行以下命令

$ php composer.phar require abhi1693/yii2-system-info "@dev"

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

{
    "require": {
        "abhi1693/yii2-system-info": "@dev"
    }
}

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

$ php composer.phar update

用法

use abhimanyu\systemInfo\SystemInfo;

// 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 

否则您将在错误日志中看到此消息:致命错误:找不到类 'COM'

贡献

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