PHPackages                             anteris-dev/os-helper - 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. anteris-dev/os-helper

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

anteris-dev/os-helper
=====================

Provides basic helpers for Operating System names.

v0.1.0(5y ago)3911MITPHP

Since Apr 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Anteris-Dev/os-helper)[ Packagist](https://packagist.org/packages/anteris-dev/os-helper)[ RSS](/packages/anteris-dev-os-helper/feed)WikiDiscussions master Synced 3w ago

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

Determine the Operating System your code is running on
======================================================

[](#determine-the-operating-system-your-code-is-running-on)

This simple package assists with determining what Operating System your code is running on. Right now the Operating Systems supported are Linux, Mac OS, and Windows. We have implemented fallbacks for Operating Systems as well.

To Install
----------

[](#to-install)

```
composer require anteris-dev/os-helper
```

Find an OS that is missing?
---------------------------

[](#find-an-os-that-is-missing)

We would love to see your contribution to this package to make it better for its users. Feel free to make a pull request to add any missing Operating Systems you stumble across.

Boolean Checks
==============

[](#boolean-checks)

You can use the `isLinux()`, `isMacOs()`, and `isWindows()` methods to run simple boolean checks about the OS.

For example:

```
use Anteris\Helper\OS;

if ( OS::isLinux() ) {
    echo 'Running on Linux!';
}

if ( OS::isMacOs() ) {
    echo 'Running on Mac!';
}

if ( OS::isWindows() ) {
    echo 'Running on Windows!';
}
```

If Statements
=============

[](#if-statements)

To make the above examples more fluent, you may also use the if methods to perform if statements.

For example:

```
use Anteris\Helper\OS;

OS::ifLinux(function () {
    echo 'Running on Linux!';
});

OS::ifMacOs(function () {
    echo 'Running on Mac!';
});

Os::ifWindows(function () {
    echo 'Running on Windows!';
});
```

Getting the OS Friendly Name
============================

[](#getting-the-os-friendly-name)

You can get the friendly name of the Operating System using the `name()` method. The OS name may span multiple words (e.g. "Mac OS") and include capitilized letters.

For example:

```
use Anteris\Helper\OS;

// On a Mac machine, this would output: Mac OS

echo OS::name();
```

Getting the OS Short Name
=========================

[](#getting-the-os-short-name)

The OS shortname is great for making comparisons with. The OS name has all spaces removed and is made to be all lowercase.

For example:

```
use Anteris\Helper\OS;

// On a Mac machine, this would output: macos

echo OS::shortName();
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1888d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dca3c3ac71024f7878526a0fe0a384fbf198ed711fe7e7bb34177a1dbc849f6?d=identicon)[golthem](/maintainers/golthem)

---

Top Contributors

[![aidan-casey](https://avatars.githubusercontent.com/u/6686277?v=4)](https://github.com/aidan-casey "aidan-casey (3 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/anteris-dev-os-helper/health.svg)

```
[![Health](https://phpackages.com/badges/anteris-dev-os-helper/health.svg)](https://phpackages.com/packages/anteris-dev-os-helper)
```

###  Alternatives

[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.7M135](/packages/webpatser-laravel-uuid)[php-ds/php-ds

Specialized data structures as alternatives to the PHP array

4109.3M161](/packages/php-ds-php-ds)[odolbeau/phone-number-bundle

Integrates libphonenumber into your Symfony application

24810.9M16](/packages/odolbeau-phone-number-bundle)[wp-cli/wp-config-transformer

Programmatically edit a wp-config.php file.

8510.5M8](/packages/wp-cli-wp-config-transformer)[sagem-cassiopee/php-metar-decoder

METAR weather observation decoder

527.8k](/packages/sagem-cassiopee-php-metar-decoder)[assistant-engine/filament-assistant

A Filament Assistant package that enables AI features, bringing advanced assistant capabilities directly into Filament.

392.7k](/packages/assistant-engine-filament-assistant)

PHPackages © 2026

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