wheregroup/platform-detect

Platform detection for PHP

0.0.1 2019-09-20 09:21 UTC

This package is auto-updated.

Last update: 2024-03-20 19:40:49 UTC


README

Detect / distinguish operating system platform in PHP.

Unlinke a simple directory separator test, can tell the difference between Mac OS X, BSD and Linux, and recognizes Cygwin as Windows, not as a generic unix. See consts definitions for possible detection outcomes.

Can also detect legacy 32 bit platforms.

php > $platform = \WhereGroup\PlatformDetect\Platform::guess();
php > echo $platform->getOrder() . "\n";
NIX
php > echo $platform->getFamily() . "\n";
LINUX
php > echo $platform->getBitness() . "\n";
64