PHPackages                             tivie/php-os-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tivie/php-os-detector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tivie/php-os-detector
=====================

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

1.1.0(8y ago)201.6M—8.4%5[1 issues](https://github.com/tivie/php-os-detector/issues)11APACHE 2.0PHPPHP &gt;=5.3.0CI failing

Since Dec 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tivie/php-os-detector)[ Packagist](https://packagist.org/packages/tivie/php-os-detector)[ Docs](http://tivie.github.com/php-os-detector/)[ RSS](/packages/tivie-php-os-detector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (11)

PHP OS Detector
===============

[](#php-os-detector)

[![Latest Stable Version](https://camo.githubusercontent.com/e5d0fd7c527320587df0dac53d262ccf8b10082c9378688f4791f701f8a39cf5/68747470733a2f2f706f7365722e707567782e6f72672f74697669652f7068702d6f732d6465746563746f722f762f737461626c652e737667)](https://packagist.org/packages/tivie/php-os-detector)[![Total Downloads](https://camo.githubusercontent.com/889547a0286d8f37b844a68bce620f1fb40201af7792f3cf8a7396fb810cb4ba/68747470733a2f2f706f7365722e707567782e6f72672f74697669652f7068702d6f732d6465746563746f722f646f776e6c6f6164732e737667)](https://packagist.org/packages/tivie/php-os-detector)[![License](https://camo.githubusercontent.com/d10e0c4256817687a5f998f8d0be28d21aa1f344bbcf95681bba54b0d014263c/68747470733a2f2f706f7365722e707567782e6f72672f74697669652f7068702d6f732d6465746563746f722f6c6963656e73652e737667)](https://packagist.org/packages/tivie/php-os-detector)

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

Compatibility
-------------

[](#compatibility)

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

Installation
------------

[](#installation)

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

### Git clone

[](#git-clone)

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

```

### Composer

[](#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
-------------

[](#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
----------

[](#contribute)

Feel free to contribute by forking or making suggestions.

Issue tracker:

Source code:

License
-------

[](#license)

Command Library is released under Apache 2.0 license. For more information, please consult the [LICENSE file in this repository](https://github.com/tivie/php-os-detector/blob/master/LICENSE) or .

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1037 days

Total

2

Last Release

3132d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f735d8fb97242e69e2da4cd77f5a98114b307e042d91c9316803243744d9f7e?d=identicon)[Tivie](/maintainers/Tivie)

---

Top Contributors

[![tivie](https://avatars.githubusercontent.com/u/1608730?v=4)](https://github.com/tivie "tivie (19 commits)")[![EmanueleCoppola](https://avatars.githubusercontent.com/u/12816305?v=4)](https://github.com/EmanueleCoppola "EmanueleCoppola (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

detectordetectionidentificationosoperating systemos detection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tivie-php-os-detector/health.svg)

```
[![Health](https://phpackages.com/badges/tivie-php-os-detector/health.svg)](https://phpackages.com/packages/tivie-php-os-detector)
```

###  Alternatives

[shipmonk/composer-dependency-analyser

Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)

6156.7M435](/packages/shipmonk-composer-dependency-analyser)[cbschuld/browser.php

A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.

5876.7M19](/packages/cbschuld-browserphp)[patrickschur/language-detection

A language detection library for PHP. Detects the language from a given text string.

8513.2M18](/packages/patrickschur-language-detection)[thadafinser/user-agent-parser

UserAgent parsing done right http://useragent.mkf.solutions/

249316.9k2](/packages/thadafinser-user-agent-parser)[foroco/php-browser-detection

Ultra fast PHP library to detect browser, OS, platform and device type by User-Agent parsing

1554.7M7](/packages/foroco-php-browser-detection)[nitotm/efficient-language-detector

Fast and accurate natural language detection. Detector written in PHP. Nito-ELD, ELD.

59252.9k6](/packages/nitotm-efficient-language-detector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
