定制 tivie/php-os-detector 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tivie/php-os-detector

最新稳定版本:1.1.0

Composer 安装命令:

composer require tivie/php-os-detector

包简介

A small utility library that detects the OS the server is running on

README 文档

README

Latest Stable Version Total Downloads License

A small PHP utility library that detects the OS the server is running on.

Compatibility

Although only tested in PHP 7, PHP OS Detector should be compatible with PHP 5.3 or greater

Installation

You can install it by cloning the git repository or using composer.

Git clone

git clone https://github.com/tivie/php-os-detector.git

Composer

Add these lines to your composer.json:

    {
        "require": {
            "tivie/php-os-detector": "*"
        }
    }

or run the following command:

php composer.phar require tivie/php-os-detector

Usage Example

$os = new \Tivie\OS\Detector();
$kernelName = $os->getKernelName();
if ($os->isUnixLike()) {
    echo "I'm using a Unix like system with kernel $kernelName";
} else if ($os->isWindowsLike()) {
    echo "I'm using a Windows like system with kernel $kernelName";
} else {
    echo "I'm using a non-Unix non-Windows system";
}

Contribute

Feel free to contribute by forking or making suggestions.

Issue tracker: https://github.com/tivie/php-os-detector/issues

Source code: https://github.com/tivie/php-os-detector

License

Command Library is released under Apache 2.0 license. For more information, please consult the LICENSE file in this repository or http://www.apache.org/licenses/LICENSE-2.0.txt.

统计信息

  • 总下载量: 1.6M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 22
  • 点击次数: 8
  • 依赖项目数: 11
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: APACHE
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固